Created
August 27, 2014 19:11
-
-
Save patch/04c3e8ad885062e1f479 to your computer and use it in GitHub Desktop.
PHP localized date/time
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
$date_fmt = new IntlDateFormatter( | |
'pt-BR', | |
IntlDateFormatter::SHORT, | |
IntlDateFormatter::SHORT, | |
'America/New_York', | |
IntlDateFormatter::GREGORIAN, | |
); | |
# $date may be DateTime object, IntlCalendar object, seconds since epoch, or localtime array | |
$formatted = $date_fmt->format($date); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment