|
Posted by Janwillem Borleffs on 08/28/05 18:41
Jochem wrote:
> The standard output of a PHP function (like date, time etc) is
> English. However, I need to translate them to Danish. Does anybody
> know a easy way to do this? Is there a functionality to do
> translations like this I am not aware of?
>
> The main issue is to translate things like "Tuesday, 11 October 2005"
> into Danish (or any other language for that matter).
>
You can use the setlocale() function:
/* Set locale to Danish */
setlocale(LC_ALL, 'da_DK.ISO_8859-1');
/* Output: fredag 22 december 1978 */
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
This is based on the info found at http://www.php.net/setlocale; also notice
the user contribution from misc dot anders at feder dot dk
on that page.
JW
Navigation:
[Reply to this message]
|