php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30678 strtotime() has problems with Halloween
Submitted: 2004-11-03 20:27 UTC Modified: 2004-11-03 20:58 UTC
From: alexbo at delphian dot org Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.0.1 OS: RedHat 9 (Kernel 2.4.20-20.9smp)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alexbo at delphian dot org
New email:
PHP Version: OS:

 

 [2004-11-03 20:27 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-03 20:58 UTC] derick@php.net
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.

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 10:01:30 2025 UTC