Automattic\WooCommerce\Internal\PushNotifications\Entities
PushToken::to_rest_datetime
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() 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 );
}