wp_checkdate( int $month, int $day, int $year, string $source_date )

Test if the supplied date is valid for the Gregorian calendar.


Parameters

$month

(Required) Month number.

$day

(Required) Day number.

$year

(Required) Year number.

$source_date

(Required) The date to filter.


Return

(bool) True if valid date, false if not valid date.


Source

File: wp-includes/functions.php

function wp_checkdate( $month, $day, $year, $source_date ) {
	/**
	 * Filters whether the given date is valid for the Gregorian calendar.
	 *
	 * @since WP-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 );
}


Changelog

Changelog
Version Description
WP-3.5.0 Introduced.