php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25697 Locale-specific formats of strftime() do not work
Submitted: 2003-09-29 18:07 UTC Modified: 2003-09-29 21:45 UTC
From: joho at webbplatsen dot se Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.3 OS: SuSE Linux 8.x, 2.4.19-4GB kerne
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: joho at webbplatsen dot se
New email:
PHP Version: OS:

 

 [2003-09-29 18:07 UTC] joho at webbplatsen dot se
Description:
------------
After upgrading our system to PHP 4.3.2, setlocate() no longer seemed to have any effect. I later upgraded to PHP 4.3.3 but find the same problem present. No compile-time problems are reported.

Uppercase/lowercase of Swedish national characters no longer works either.

Reproduce code:
---------------
Code from the PHP manual (fails):

/* Set locale to Dutch */
setlocale (LC_ALL, 'nl_NL');

/* Output: vrijdag 22 december 1978 */
echo strftime ("%A %e %B %Y", mktime (0, 0, 0, 12, 22, 1978));

/* try different possible locale names for german as of PHP 4.3.0 */
$loc_de = setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
echo "Preferred locale for german on this system is '$loc_de'";

Own code (fails):

        setlocale (LC_ALL, 'sv_SV');
        return
            (
            ucfirst (strftime ("%a")) .
            " " .
            date ("Y-m-d") .
            " ".
            "V." .
            strftime ("%V")
            );



Expected result:
----------------
Own code should result in this:

Tis 2003-09-30 V.40

(if run on 2003-09-30, that is ;)


Actual result:
--------------
Tue 2003-09-30 V.40

And no, I am not certain I have not done something wrong, but since this behavior changed after we installed 4.3.2.. ???


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-29 19:13 UTC] moriyoshi@php.net
Try

$ locale -a | grep "sv_SV"

to see if your system supports that locale.

 [2003-09-29 21:45 UTC] sniper@php.net
Locale names differ from system to system. 
Given the correct one for your system will give correct results. Not PHP bug.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 05 06:01:28 2024 UTC