note 40396 added to function.setlocale
| From: | bogdan at iHost dot ro | Date: | Tue, 02 Mar 2004 19:53:56 +0000 |
| Subject: | note 40396 added to function.setlocale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66126@lists.php.net to get a copy of this message | ||
On some systems (at least FreeBSD 4.x) the format for a
locale' is, for example,
ro_RO.ISO8859-2. If you use ro_RO instead setlocale will return FALSE. Just browse in
/usr/share/locale and see what is the name of the directory holding your locale' and use
that name in your scripts:
<?php
clearstatcache();
$pos = strrpos ($_SERVER["PHP_SELF"], "/");
$fisier = substr ($_SERVER["PHP_SELF"], $pos + 1);
$result = filemtime ($fisier);
$local = setlocale (LC_TIME, 'ro_RO.ISO8859-2');
if ($local == "ro_RO.ISO8859-2") {
$modtime = strftime '%e %B %Y %H:%M', $result);
} else {
$modtime = strftime ('%d.%m.%Y %H:%M', $result);
}
printf ("Ultima actualizare: %s\\n", $modtime);
?>
----
Manual Page -- http://www.php.net/manual/en/function.setlocale.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40396
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40396&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40396&report=yes
Search -- http://master.php.net/manage/user-notes.php