#47574 [Opn->Bgs]: date() function works incorrect :-(
| From: | mattwil@php.net | Date: | Thu, 05 Mar 2009 17:22:05 +0000 |
| Subject: | #47574 [Opn->Bgs]: date() function works incorrect :-( | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-134437@lists.php.net to get a copy of this message | ||
ID: 47574
Updated by: mattwil@php.net
Reported By: privatevideo at list dot ru
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Windows
PHP Version: 5.2.9
New Comment:
We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which
do
not suffer from DST.
Previous Comments:
------------------------------------------------------------------------
[2009-03-05 16:57:39] privatevideo at list dot ru
Description:
------------
date() function works incorrect :-(
Reproduce code:
---------------
# check line 179-180, it should add a minute every step
for ($i=0,$d=1224964800;$d<=1225051200;$d+=60,++$i)
echo "<br>$i -> ".date('Y-m-d H:i:s',$d);
Expected result:
----------------
179 -> 2008-10-26 02:59:00
180 -> 2008-10-26 03:00:00
181 -> 2008-10-26 03:01:00
182 -> 2008-10-26 03:02:00
Actual result:
--------------
179 -> 2008-10-26 02:59:00
180 -> 2008-10-26 02:00:00
181 -> 2008-10-26 02:01:00
182 -> 2008-10-26 02:02:00
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47574&edit=1