php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22782 mktime funcktion fail
Submitted: 2003-03-19 02:57 UTC Modified: 2003-03-19 04:37 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: ameoba32 at riscom dot net Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.1 OS: W2K
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: ameoba32 at riscom dot net
New email:
PHP Version: OS:

 

 [2003-03-19 02:57 UTC] ameoba32 at riscom dot net
echo date("H:i:s d-m-Y", mktime(0,0,0,4,364,2002))."\n";
echo date("H:i:s d-m-Y", mktime(1,0,0,4,364,2002))."\n";

prints this result:

01:00:00 30-03-2003
01:00:00 30-03-2003

364 is magic day number :) all other days works perfect.
thank you.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-19 04:12 UTC] patrick at sorrynospam dot org
that seems to be correct though. 
remember that:
333: 01:00:00 27-02-2003
334: 01:00:00 28-02-2003  !!!!
335: 01:00:00 01-03-2003

see:
for($i=1; $i < 400; $i++){
	echo date("$i: H:i:s d-m-Y", mktime(1,0,0,4,$i,2002))."<BR>\n";

}
 [2003-03-19 04:37 UTC] georg@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.

This is also documented in the manual.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 09:01:33 2025 UTC