making sure only valid datetimes occur