validate dates and times