note 44685 added to function.setlocale
| From: | dv at josheli dot com | Date: | Thu, 12 Aug 2004 23:04:25 +0000 |
| Subject: | note 44685 added to function.setlocale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74564@lists.php.net to get a copy of this message | ||
On Novell Netware, the language codes require hyphens, not underscores, and using anything other
than LC_ALL doesn't work directly.
So... (from their support list)....
You have to set TIME, NUMERIC etc. info in two steps as given below rather than one. This is due to
the limitation of setlocale function of LibC.
<?php
setlocale(LC_ALL, 'es-ES');
$loc = setlocale(LC_TIME, NULL);
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
// jeuves 22 diciembre 1978
?>
This should work.
or of course, reset LC_ALL...
<?php
setlocale(LC_ALL, 'es-ES');
echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
setlocale(LC_ALL, '');
// jeuves 22 diciembre 1978
?>
----
Manual Page -- http://www.php.net/manual/en/function.setlocale.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44685
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44685&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44685&report=yes
Search -- http://master.php.net/manage/user-notes.php