Skip to content

IsDateValid

See Also: Time and Date Functions

Purpose

The IsDateValid function returns True if the date is valid.

Return Type

Boolean

Syntax

(IsDateValid({dtVar}))

Where:

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