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.

Метод класса: PushToken{}

Хуков нет.

Возвращает

string|null.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->to_rest_datetime( ?string $datetime ): ?string;
?string $datetime(обязательный)
.

Код PushToken::to_rest_datetime() WC 11.3.0

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