Bug #61338 [Opn->Csd]: 'strftime' error when 'setlocale(LC_ALL, 'da_DK');'
| From: | claus at marcussen dot eu | Date: | Sat, 10 Mar 2012 12:50:29 +0000 |
| Subject: | Bug #61338 [Opn->Csd]: 'strftime' error when 'setlocale(LC_ALL, 'da_DK');' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-168329@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61338&edit=1
ID: 61338
User updated by: claus at marcussen dot eu
Reported by: claus at marcussen dot eu
Summary: 'strftime' error when 'setlocale(LC_ALL,
'da_DK');'
-Status: Open
+Status: Closed
Type: Bug
Package: Date/time related
Operating System: Linux srv142 2.6.26-2-vserver-am
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
Sorry, me mistake. Not "UTF-8"
Previous Comments:
------------------------------------------------------------------------
[2012-03-10 09:18:21] claus at marcussen dot eu
Test source here : http://fredericia-skakforening.dk/Test/datotest.php
It seems like it is weekend days that can be done.
------------------------------------------------------------------------
[2012-03-10 09:04:12] claus at marcussen dot eu
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 this bug report at https://bugs.php.net/bug.php?id=61338&edit=1