php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40819 setlocale randomly ignored
Submitted: 2007-03-15 11:33 UTC Modified: 2007-04-20 17:29 UTC
From: matthijs at 1key dot nl Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.1 OS: Windows Server 2003 R2 Standard
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: matthijs at 1key dot nl
New email:
PHP Version: OS:

 

 [2007-03-15 11:33 UTC] matthijs at 1key dot nl
Description:
------------
On top of my script I inserted setlocale(LC_ALL, 'nld_NLD'); Sometimes it displays the local date using strftime and sometimes the english date. I cannot find any patern, it seems to happen randomly.

Reproduce code:
---------------
setlocale(LC_ALL, 'nld_NLD');
echo strftime('%A %d %B %Y om %H:%M', date());

Expected result:
----------------
donderdag 08 maart 2007 om 08:25

Actual result:
--------------
Thursday 08 March 2007 om 08:25

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-15 12:34 UTC] mike@php.net
If you're using ISAPI, note that setlocale() is not thread safe.
 [2007-03-15 12:36 UTC] matthijs at 1key dot nl
I am using Apache 2 not IIS..
 [2007-03-15 12:43 UTC] mike@php.net
Ok, but mpm_winnt is still multithreaded, only way to avoid is using (f)cgi on Windows.
 [2007-03-28 13:23 UTC] matthijs at 1key dot nl
I don't understand your last comment. What is the easyest solution for this problem?
 [2007-04-20 17:24 UTC] matthijs at 1key dot nl
Still waiting for reaction.
 [2007-04-20 17:29 UTC] tony2001@php.net
setlocale() is not threadsafe and you're using threaded API.
This is documented and expected.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 20 23:00:02 2025 UTC