Function Reference


_DateIsValid

Checks the given date to determine if it is a valid date

#include <Date.au3>
_DateIsValid ( $sDate )

Parameters

$sDate The date to be checked.

Return Value

Success: 1.
Failure: 0 if the specified date is not valid.

Remarks

This function takes a date input in one of the following formats:
"yyyy/mm/dd[ hh:mm[:ss]]" or "yyyy/mm/dd[Thh:mm[:ss]]"
"yyyy-mm-dd[ hh:mm[:ss]]" or "yyyy-mm-dd[Thh:mm[:ss]]"
"yyyy.mm.dd[ hh:mm[:ss]]" or "yyyy.mm.dd[Thh:mm[:ss]]"

Example

#include <Date.au3>
#include <MsgBoxConstants.au3>

Local $sDate = @YEAR & "/" & @MON & "/" & @MDAY

If _DateIsValid($sDate) Then
        MsgBox($MB_SYSTEMMODAL, "Valid Date", "The specified date is valid.")
Else
        MsgBox($MB_SYSTEMMODAL, "Valid Date", "The specified date is invalid.")
EndIf