php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11805 missing 3600 seconds between 10/13/2001 and 10/15/2001
Submitted: 2001-06-29 13:49 UTC Modified: 2001-06-30 04:57 UTC
From: php at reguly dot net Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.0.5 OS: debian gnu/linux
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: php at reguly dot net
New email:
PHP Version: OS:

 

 [2001-06-29 13:49 UTC] php at reguly dot net
Hello,

I am trying to write the days between 10/13/2001 and 10/15/20001:

$i = mktime(0,0,0,10,13,2001);// --> 1002942000 
$j = mktime(0,0,0,10,15,2001);// --> 1003111200

while ( $i <= $j ) {
  echo date("m-d-Y",$i);
  $i +=86400; 
}

but it stops on 10/14/2001, because 

    1002942000 ( $i )
          + 86400
          + 86400  
----------------------------
=  1003114800 
  - 1003111200 ( $j ) 
------------------------------
=             3600  ( should be zero ! )

I 've made a work-around using date(m,d+1,Y),
but somebdoy please explain me where are the
3600 seconds that are missing ?

Thanks,
gabriel


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-29 14:52 UTC] sniper@php.net
Does this happen with PHP 4.0.6? (I can't reproduce this with it)

 [2001-06-30 04:57 UTC] hholzgra@php.net
daylight saving time !

look for the optional seventh parameter to mktime
on http://php.net/mktime
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 08:01:29 2025 UTC