I have a script that needs to display date data to an international audience - e.g.
"submitted Tue 25 Aug 09"
Is there an easier/cleaner way to get this converted to the French(etc) equivalent "Mar 25 Aoû 09" than:
Setting a constant LANG
and a $LANGUAGES
array of include files & :
if(LANG != 'EN') { include $LANGUAGES['LANG']; }
& then the included file maps the days & months & replaces for the appropriate locale?
I think you can't get away from doing so without setting LOCALE:
<?php setlocale(LC_ALL, 'fr_FR'); echo strftime("%A %e %B %Y"); ?>
Some details on strftime: http://us2.php.net/manual/en/function.strftime.php
According to the date
function's manual page, you should use setlocale
. Methods such as strftime
will then use the locale specified. date
, however, will not for some reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With