#30678 [Opn->Bgs]: strtotime() has problems with Halloween
| From: | derick@php.net | Date: | Wed, 03 Nov 2004 19:58:39 +0000 |
| Subject: | #30678 [Opn->Bgs]: strtotime() has problems with Halloween | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-68663@lists.php.net to get a copy of this message | ||
ID: 30678
Updated by: derick@php.net
Reported By: alexbo at delphian dot org
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: RedHat 9 (Kernel 2.4.20-20.9smp)
PHP Version: 5.0.1
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:
------------------------------------------------------------------------
[2004-11-03 20:27:21] alexbo at delphian dot org
Description:
------------
Halloween, according to strtotime(), is both Sunday and Monday this
year. I haven't checked other years, but I just ran into this.
Uh... that's all I've got for you.
Reproduce code:
---------------
echo("<p>");
echo(date("d_M_y",mktime(0,0,0,10,30,04)));
echo("</p><p>");
echo(date("d_M_y",strtotime("tuesday",mktime(0,0,0,10,30,04))));
echo("</p><p>");
echo(date("d_M_y",strtotime("monday",mktime(0,0,0,10,30,04))));
echo("</p><p>");
echo(date("d_M_y",strtotime("sunday",mktime(0,0,0,10,30,04))));
echo("</p>");
Expected result:
----------------
30_Oct_04
02_Nov_04
01_Nov_04
31_Oct_04
Actual result:
--------------
30_Oct_04
01_Nov_04
31_Oct_04
31_Oct_04
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30678&edit=1