#36763 [Opn->Bgs]: Strftime bug
| From: | derick@php.net | Date: | Thu, 16 Mar 2006 20:34:45 +0000 |
| Subject: | #36763 [Opn->Bgs]: Strftime bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-94436@lists.php.net to get a copy of this message | ||
ID: 36763
Updated by: derick@php.net
Reported By: nath2 dot munier at free dot fr
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Mandrake10
PHP Version: 4.4.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
%G is the ISO year, not the "real" year. See http://no.php.net/strftime
Previous Comments:
------------------------------------------------------------------------
[2006-03-16 21:28:34] nath2 dot munier at free dot fr
Description:
------------
After some incomprehensible bug, I focus on this test:
Any explanation ?
Reproduce code:
---------------
<?
$TmpYear = 2005;
$TestTs = mktime(0, 0, 0, 1, 2, $TmpYear);
echo "<br>Comp : ".strftime("%d %B %G %T", $TestTs);
echo "<br>jour : ".strftime("%d", $TestTs);
echo "<br>mois : ".strftime("%m", $TestTs);
echo "<br>anne : ".strftime("%G", $TestTs);
$TestTs = mktime(0, 0, 0, 1, 3, $TmpYear);
echo "<br>Comp : ".strftime("%d %B %G %T", $TestTs);
echo "<br>jour : ".strftime("%d", $TestTs);
echo "<br>mois : ".strftime("%m", $TestTs);
echo "<br>anne : ".strftime("%G", $TestTs);
?>
Expected result:
----------------
2005 for both for the year.
Actual result:
--------------
2004 for 1rst of january.
2005 for third january.
Same problem with 1999
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36763&edit=1