From: julientld at free dot fr Operating system: Windows Server 2003 SP1 PHP version: 5.1.2 PHP Bug Type: Date/time related Bug description: strftime() randomly do not use setlocale()
Description: ------------ Hello, Finally I decide to submit here a problem that I obtain with PHP from a lot of years. So I have had this problem with PHP 4.x and Windows 2000 (IIS 5.0) and yet with PHP 5.x and Windows Server 2003 (IIS 6.0). My problem is related to the function strftime() which I use to display dates in my language (French). Sometimes, dates are displayed in French like I want and sometimes dates are displayed in English without any modification of the code. If I refresh the same page 20 times, per exemple, the date will be in English 2 or 3 times and in French the rest of the times. It's very strange and I do not understand why! It just seems to be a bug, no? For setting the local time, I use setlocale(LC_ALL,"fra"); (I tried also setlocale(LC_ALL,"fr_FR"); and other variants). The function setlocale(LC_ALL,"fra"); is present in an included file which is ever called at the top of the page. In the release notes of PHP 5.1, I seen that a new parameter in the php.ini has been added to set the time zone (I set it to Europe/Paris). I hoped it's will help me to resolve the problem but not :-( I seen other persons that have problems with setlocale() and included files. Do you know if it is a PHP bug or a problem in my scripts? Thanks Reproduce code: --------------- echo (strftime("%A %d %B %Y",$timestamp_from_database->date)); -- Edit bug report at http://bugs.php.net/?id=36642&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36642&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36642&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36642&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36642&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36642&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36642&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36642&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36642&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36642&r=support Expected behavior: http://bugs.php.net/fix.php?id=36642&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36642&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36642&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36642&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36642&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36642&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36642&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36642&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36642&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36642&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36642&r=mysqlcfg