Created
March 16, 2014 22:34
-
-
Save drmalex07/9590831 to your computer and use it in GitHub Desktop.
An example for a localized formatted date in PHP. #php #datetime #i18n
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 | |
$expected_duration = new DateInterval("PT03H30M"); /* 03:30:00 or 3h 30min */ | |
$expected_at = new DateTime('now'); | |
$expected_at->add($expected_duration); | |
$formatter = new IntlDateFormatter('el_GR', IntlDateFormatter::LONG, IntlDateFormatter::SHORT); | |
print $formatter->format($expected_at); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment