Created
August 24, 2016 17:03
-
-
Save nrjones8/0a625aa8d07c94a582fc1517b04b0b15 to your computer and use it in GitHub Desktop.
PHP's interpretation of RFC 3339 serialization of a UTC timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$timezone = new \DateTimeZone('UTC'); | |
$needed_time = new \DateTime('2019-11-06 18:20:56', $timezone); | |
echo $needed_time->getTimezone()->getName() . "\n"; | |
echo $needed_time->format(DATE_RFC3339) . "\n"; | |
// Output (note the +00:00 instead of "Z") | |
// UTC | |
// 2019-11-06T18:20:56+00:00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment