WordPress at a glance
function is not described

rest_parse_date() WP 4.4.0

Parses an RFC3339 time into a Unix timestamp.

No Hooks.

Return

Int. Unix timestamp.

Usage

rest_parse_date( $date, $force_utc );
$date(string) (required)
RFC3339 timestamp.
$force_utc(true|false)
Whether to force UTC timezone instead of using the timestamp's timezone.
Default: false

Changelog

Since 4.4.0 Introduced.

Code of rest_parse_date() WP 5.7.2

<?php
function rest_parse_date( $date, $force_utc = false ) {
	if ( $force_utc ) {
		$date = preg_replace( '/[+-]\d+:?\d+$/', '+00:00', $date );
	}

	$regex = '#^\d{4}-\d{2}-\d{2}[Tt ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}(?::\d{2})?)?$#';

	if ( ! preg_match( $regex, $date, $matches ) ) {
		return false;
	}

	return strtotime( $date );
}