Skip to content

Instantly share code, notes, and snippets.

@Zorono
Last active July 11, 2018 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zorono/31bac3376cb8e8066e13adf717b8246f to your computer and use it in GitHub Desktop.
Save Zorono/31bac3376cb8e8066e13adf717b8246f to your computer and use it in GitHub Desktop.
<?php
$timezone = new DateTime("now", new DateTimeZone(date_default_timezone_get()));
echo '#1: ' . $timezone->format('c') . '<br />';
echo '#2: ' . date("Y-m-d\TH:i:s." .round(microtime(True) * 1000). "\\" . $timezone->format('P')) . '<br />'; // the microseconds is detailed more than others...
echo '#3: ' . date("c") . '<br />';
echo '#4: ' . $timezone->format(DateTime::ISO8601); // the timezone offest doesn't contain the 's' symbol....
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment