wp_checkdate()
Test if the supplied date is valid for the Gregorian calendar.
1 time — 0.00002 sec (very fast) | 50000 times — 0.10 sec (speed of light)
Hooks from the function
Return
true|false
. True if valid date, false if not valid date.
Usage
wp_checkdate( $month, $day, $year, $source_date );
- $month(int) (required)
- Month number.
- $day(int) (required)
- Day number.
- $year(int) (required)
- Year number.
- $source_date(string) (required)
- The date to filter.
Changelog
Since 3.5.0 | Introduced. |
Code of wp_checkdate() wp checkdate WP 5.9.3
function wp_checkdate( $month, $day, $year, $source_date ) { /** * Filters whether the given date is valid for the Gregorian calendar. * * @since 3.5.0 * * @param bool $checkdate Whether the given date is valid. * @param string $source_date Date to check. */ return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date ); }