Automattic\WooCommerce\Internal\PushNotifications\Entities

PushToken::to_rest_datetime │ private │ WC 1.0

Converts a GMT Y-m-d H:i:s datetime to Y-m-d\TH:i:s, the format wc_rest_prepare_date_response() every other _gmt field in the Woo REST API.

Method of the class: PushToken{}

No Hooks.

Returns

string|null.

Usage

// private - for code of main (parent) class only
$result = $this->to_rest_datetime( ?string $datetime ): ?string;
?string $datetime(required)
.

PushToken::to_rest_datetime() code WC 11.3.0

private function to_rest_datetime( ?string $datetime ): ?string {
	return null === $datetime ? null : str_replace( ' ', 'T', $datetime );
}