Last active
December 24, 2015 11:29
-
-
Save blar/6791278 to your computer and use it in GitHub Desktop.
DateFormatter
This file contains hidden or 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 | |
| date_default_timezone_set('Europe/Berlin'); | |
| Locale::setDefault('de_DE'); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::FULL, IntlDateFormatter::FULL); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::FULL, IntlDateFormatter::LONG); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::FULL, IntlDateFormatter::SHORT); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::LONG, IntlDateFormatter::LONG); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::SHORT, IntlDateFormatter::FULL); | |
| var_dump($formatter->format(new DateTime())); | |
| Locale::setDefault('en_US'); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::FULL, IntlDateFormatter::FULL); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::FULL, IntlDateFormatter::LONG); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::FULL, IntlDateFormatter::SHORT); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::LONG, IntlDateFormatter::LONG); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT); | |
| var_dump($formatter->format(new DateTime())); | |
| $formatter = new IntlDateFormatter(NULL, IntlDateFormatter::SHORT, IntlDateFormatter::FULL); | |
| var_dump($formatter->format(new DateTime())); | |
| string(64) "Mittwoch, 2. Oktober 2013 11:35:20 Mitteleuropäische Sommerzeit" | |
| string(39) "Mittwoch, 2. Oktober 2013 11:35:20 MESZ" | |
| string(31) "Mittwoch, 2. Oktober 2013 11:35" | |
| string(29) "2. Oktober 2013 11:35:20 MESZ" | |
| string(16) "02.10.2013 11:35" | |
| string(47) "02.10.13 11:35:20 Mitteleuropäische Sommerzeit" | |
| string(70) "Wednesday, October 2, 2013 at 11:35:20 AM Central European Summer Time" | |
| string(47) "Wednesday, October 2, 2013 at 11:35:20 AM GMT+2" | |
| string(38) "Wednesday, October 2, 2013 at 11:35 AM" | |
| string(36) "October 2, 2013 at 11:35:20 AM GMT+2" | |
| string(21) "Oct 2, 2013, 11:35 AM" | |
| string(49) "10/2/13, 11:35:20 AM Central European Summer Time" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment