IsDateValid
See Also: Time and Date Functions
Purpose
The IsDateValid function returns True if the date is valid.
Return Type
Syntax
(IsDateValid({dtVar}))
Where:
- {dtVar} is a value of type DateTime.
Example
Procedure Test
DateTime dtVar
// Get the current local time
Move (CurrentDateTime()) To dtVar
// Set the day to an invalid day, making it an invalid DateTime
Move (DateSetDay(dtVar, 99)) To dtVar
// Check the DateTime using the function
If (IsDateValid(dtVar) = 0) ;
Showln "Invalid Date!"
Else ;
Showln "The new date is " dtVar
End_Procedure