updates the dates in the database