php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15029 mktime bug
Submitted: 2002-01-14 09:50 UTC Modified: 2002-01-14 09:56 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bruno at aries dot lu Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.0.6 OS: Windows NT
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bruno at aries dot lu
New email:
PHP Version: OS:

 

 [2002-01-14 09:50 UTC] bruno at aries dot lu
The underlying code produces a bug in the time calculation of "mktime". The 28th October 2001 has got 25 hours!!!

<?
  function string2date($dat)
  {
    $resu = substr($dat,6,4).substr($dat,3,2).substr($dat,0,2);
    
    return $resu;
  };
  
$date =  "25.10.2001";
$stDate4 = "30.10.2001";
$day = substr($date,0,2);
$month = substr($date,3,2);
$year = substr($date,6,4);

$current_date = mktime (0,0,0,$month,$day,$year);

while ($date != $stDate4)
  {
    // add 1 day = 86400 seconds to the timestamp
    $current_date = $current_date + 86400;
    $date = date ("d.m.Y",$current_date);
    $Date = string2date($date);

/*  // this overrides the bug  
    if ($first_date == $Date)
    {
      $current_date = $current_date + 86400;
      $date = date ("d.m.Y",$current_date);
      $Date = string2date($date);
    }
*/
   echo "$Date<br>";
  }

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-14 09:56 UTC] derick@php.net
Yeah, cause that is the date on which summertime becomes wintertime (daylight savings time). Not a bug > bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 18:01:32 2024 UTC