From:             
Operating system: Linux srv142 2.6.26-2-vserver-am
PHP version:      5.3.10
Package:          Date/time related
Bug Type:         Bug
Bug description:'strftime' error when 'setlocale(LC_ALL, 'da_DK');'

Description:
------------
'strftime' don't work correct when 'setlocale(LC_ALL, 'da_DK');' are done.

Test script:
---------------
        $Dato1 = '2012-04-21';
        $Dato2 = '2012-04-22';
        $Dato3 = '2012-04-23';
        $DatoStr1 = strtotime($Dato1);
        $DatoStr2 = strtotime($Dato2);
        $DatoStr3 = strtotime($Dato3);
        
        echo htmlentities(ucfirst(strftime('%A d. %d.', $DatoStr1)), ENT_QUOTES,
"UTF-8") . '  ' . $DatoStr1 . '<br/>';
        echo htmlentities(ucfirst(strftime('%A d. %d.', $DatoStr2)), ENT_QUOTES,
"UTF-8") . '  ' . $DatoStr2 . '<br/>';
        echo htmlentities(ucfirst(strftime('%A d. %d.', $DatoStr3)), ENT_QUOTES,
"UTF-8") . '  ' . $DatoStr3 . '<br/>';

        echo '<br/>';
        
        setlocale(LC_ALL, 'da_DK');
        $Dato1 = '2012-04-21';
        $Dato2 = '2012-04-22';
        $Dato3 = '2012-04-23';
        $DatoStr1 = strtotime($Dato1);
        $DatoStr2 = strtotime($Dato2);
        $DatoStr3 = strtotime($Dato3);
        
        echo htmlentities(ucfirst(strftime('%A d. %d.', $DatoStr1)), ENT_QUOTES,
"UTF-8") . '  ' . $DatoStr1 . '<br/>';
        echo htmlentities(ucfirst(strftime('%A d. %d.', $DatoStr2)), ENT_QUOTES,
"UTF-8") . '  ' . $DatoStr2 . '<br/>';
        echo htmlentities(ucfirst(strftime('%A d. %d.', $DatoStr3)), ENT_QUOTES,
"UTF-8") . '  ' . $DatoStr3 . '<br/>';


Expected result:
----------------
The same result (excl. language).


-- 
Edit bug report at https://bugs.php.net/bug.php?id=61338&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=61338&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=61338&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=61338&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=61338&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61338&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=61338&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=61338&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=61338&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=61338&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=61338&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=61338&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=61338&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=61338&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=61338&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=61338&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61338&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=61338&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=61338&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=61338&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=61338&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=61338&r=mysqlcfg

Reply via email to