|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-09-16 09:58 UTC] salathe@php.net
-Status: Open
+Status: Bogus
[2011-09-16 09:58 UTC] salathe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 16:00:01 2025 UTC |
Description: ------------ class DateTime return wrong (1 to less) formated date strftime and date the right one Output of demo code ~/build/php-5.3.8/sapi/cli# php -f /home/greenrover/www/test.php DateTime: September 2006 strftime: Oktober 2006 date: October 2006 Test script: --------------- <?php $unixTimestamp = '1159653600'; $d = date_create('@'.$unixTimestamp); setlocale(LC_TIME, array('de_CH.UTF-8', 'de_DE@UTF-8', 'de_DE@euro', 'deu')); echo "DateTime: ".$d->format('F Y'); echo "\n"; echo "strftime: ".strftime("%B %Y", $unixTimestamp); echo "\n"; echo "date: ".date('F Y', $unixTimestamp); echo "\n"; Expected result: ---------------- DateTime: Oktober 2006 strftime: Oktober 2006 date: October 2006 Actual result: -------------- DateTime: September 2006 strftime: Oktober 2006 date: October 2006