Improved date and time validation.