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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 10:01:32 2024 UTC