Skip to content

Instantly share code, notes, and snippets.

@pedro-stanaka
Created March 26, 2018 15:20
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 pedro-stanaka/2179a2453ca39ce9aff53ac297f513e6 to your computer and use it in GitHub Desktop.
Save pedro-stanaka/2179a2453ca39ce9aff53ac297f513e6 to your computer and use it in GitHub Desktop.
Date Formatting with Intl
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'UTC',
IntlDateFormatter::GREGORIAN,
"y-MM-dd'T'H:mm:ssX"
);
$date = new DateTime();
echo $fmt->format($date->getTimestamp());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment