no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


date_localization [2011/06/09 18:46] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +===== Date Localization =====
 +You can localize the date and time within PHP by following these steps:
  
 +1. Verify that the correct locales are installed on the server.
 +<code bash>
 +> locale -a
 +aa_DJ
 +aa_DJ.iso88591
 +aa_DJ.utf8
 +aa_ER
 +aa_ER@saaho
 +aa_ER.utf8
 +aa_ER.utf8@saaho
 +aa_ET
 +...
 +</code>
 +2. Set the locale within PHP.
 +<code php>
 +setlocale(LC_TIME, 'fr_FR');
 +</code>
 +3. Call strftime() to output the localized date.
 +<code php>
 +echo strftime('%e %B %Y');
 +</code>

Navigation
QR Code
QR Code date_localization (generated for current page)