You can use the IntlDateFormatter class (PHP> = 5.3)
To quote an example from the IntlDateFormatter::format() page:
$fmt = new IntlDateFormatter( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN ); echo "First Formatted output is ".$fmt->format(0); $fmt = new IntlDateFormatter( "de-DE" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN ); echo "Second Formatted output is ".$fmt->format(0);
It will display:
First Formatted output is Wednesday, December 31, 1969 4:00:00 PM PT Second Formatted output is Mittwoch, 31. Dezember 1969 16:00 Uhr GMT-08:00
source share