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: | Returns 1. |
Failure: | Returns 0 if the specified date is not valid. |
@Error: | 0 = No error. |
1 = Invalid date format. | |
2 = Badly formed month. | |
3 = Badly formed day. | |
4 = Badly formed year. | |
5 = Month is out of range. | |
6 = Day is out of range. | |
7 = Year is out of range. | |
8 = Not a leap year. |
Remarks
This function takes a date input in one of the following formats:
Related
None.
Example
#include <Date.au3>
$sDate = @MON & "/" & @MDAY & "/" & @YEAR
If _DateIsValid( $sDate ) Then
MsgBox( 4096, "Valid Date", "The specified date is valid." )
Else
MsgBox( 4096, "Valid Date", "The specified date is invalid." )
EndIf