|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-14 09:56 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 15:00:01 2025 UTC |
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>"; } ?>