php checkdate() function
Translation results:
[ Chess] general one armyn.<US> check; stop, suppress; check, checkThird person singular: checks Plural: checks Present participle: check Past tense: checked past Participle: checked
Run Instance»
php checkdate() functionsyntax
Function:Verify a Gregorian date
Syntax: checkdate(month,day,year)
Parameters:
Parameters | Description |
month | Required . Specifies the month, a numeric value from 1 to 12. |
day | Required. Specifies the day, a numeric value from 1 to 31. |
year | Required. Specifies the year, a numeric value from 1 to 32767. |
Description: Check if some dates are valid Gregorian dates
php checkdate() functionexample
<?php var_dump(checkdate(12,31,-220)); echo "<br>"; var_dump(checkdate(2,29,2003)); echo "<br>"; var_dump(checkdate(2,29,2004)); ?>
Click the "Run Instance" button to view the online instance
Output:
bool(false) bool(false) bool(true)