Generating Localized GMT/UTC Time and Date Strings : setlocale « Utility Function « PHP






Generating Localized GMT/UTC Time and Date Strings

 
<?php
  $ts_au = mktime();
  $ts_de = $ts_au - (9 * 3600);

  echo 'Good evening from Brisbane, where it\'s ' . date('H:m \o\n l d m Y', $ts_au) 
        . ".<br />";

  setlocale(LC_ALL, 'de_DE', 'german');

  echo 'Guten Morgen aus Berlin. Hier ist es ' 
        . strftime('%H:%M Uhr, am %A dem %d %B %Y', $ts_de) . '.';
?>
  
  








Related examples in the same category

1.Setting a default locale
2.Setting a default locale based on system environment
3.Setlocale() Options
4.Displaying Times and Dates in Other Languages
5.setlocale(LC_MONETARY, 'en_DK');
6.setlocale(LC_MONETARY, 'en_US');
7.Preferred locale for Chinese
8.Preferred locale for German
9.Preferred locale for Russian
10.To report local time for any Germans