php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38586 mktime has some problem for some day.
Submitted: 2006-08-25 00:01 UTC Modified: 2006-08-25 07:12 UTC
From: ziyunxiao at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.1.5 OS: WiNXP
Private report: No CVE-ID: None
 [2006-08-25 00:01 UTC] ziyunxiao at gmail dot com
Description:
------------
day Oct 30 has 90000 seconds a day. 
I only test year 2005,2006,2007 in Version is php 5.1.4 and 5.1.6. I didn't install 5.1.5.
the result is right on php 4.4.3

Reproduce code:
---------------
<?
$st=mktime(0, 0, 0, 10, 30,2007);
$st1=mktime(0, 0, 0, 10, 31,2007);
echo "seconds:".($st1 - $st)."<br>";
?>

Expected result:
----------------
seconds:86400

Actual result:
--------------
seconds:90000

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-25 07:12 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-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 11:01:33 2024 UTC