note 40396 deleted from function.setlocale by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 06:51:46 +0000 |
| Subject: | note 40396 deleted from function.setlocale by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196679@lists.php.net to get a copy of this message | ||
Note Submitter: bogdan at iHost dot ro
----
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);
?>