ID:               36642
 User updated by:  julientld at free dot fr
 Reported By:      julientld at free dot fr
 Status:           Wont fix
 Bug Type:         Date/time related
 Operating System: Windows Server 2003 SP1
 PHP Version:      5.1.2
 New Comment:

Thanks you Derick for your answer. In fact, you want to say that this
problem is related to the Microsoft Windows environment and not
directly to PHP?

So for the moment, with PHP 5 ans IIS 6.0, the only solution to have
dates in French is to create my own function that translate English
date's strings.


Previous Comments:
------------------------------------------------------------------------

[2006-03-07 11:05:09] [EMAIL PROTECTED]

strftime uses locales like you write. Locales are *process-wide*
settings, If you're using a threaded server like I suspect you do you
can never rely on those settings. strftime() also has nothing to do
with the new date code and will not listen to timezone settings. This
can not be solved unless we have access to a new database, that doesn't
rely on the environment. This will come with ICU's adaption in PHP 6.

------------------------------------------------------------------------

[2006-03-07 10:35:33] julientld at free dot fr

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 this bug report at http://bugs.php.net/?id=36642&edit=1

Reply via email to