Bug #61338 [Csd->Nab]: 'strftime' error when 'setlocale(LC_ALL, 'da_DK');'

From: Date: Sat, 10 Mar 2012 19:21:57 +0000
Subject: Bug #61338 [Csd->Nab]: 'strftime' error when 'setlocale(LC_ALL, 'da_DK');'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-168342@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
 Updated by:         cataphract@php.net
 Reported by:        claus at marcussen dot eu
 Summary:            'strftime' error when 'setlocale(LC_ALL,
'da_DK');'
-Status:             Closed
+Status:             Not a bug
 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



Previous Comments:
------------------------------------------------------------------------
[2012-03-10 12:50:29] claus at marcussen dot eu

Sorry, me mistake. Not "UTF-8"

------------------------------------------------------------------------
[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


Thread (4 messages)

« previous php.bugs (#168342) next »