Automattic\WooCommerce\Internal\Abilities\Domain

OrdersQuery::prepare_date_time_for_queryprivate staticWC 1.0

Prepare a date-time string as a timestamp for second-precision order queries.

Method of the class: OrdersQuery{}

No Hooks.

Returns

Int|null.

Usage

$result = OrdersQuery::prepare_date_time_for_query( $date_time ): ?int;
$date_time(string) (required)
Date-time string.

OrdersQuery::prepare_date_time_for_query() code WC 11.0.1

private static function prepare_date_time_for_query( string $date_time ): ?int {
	try {
		return wc_string_to_datetime( $date_time )->getTimestamp();
	} catch ( \Exception $exception ) {
		return null;
	}
}