note 62738 deleted from ref.datetime by felipe

From: Date: Mon, 10 Dec 2007 17:47:50 +0000
Subject: note 62738 deleted from ref.datetime by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133206@lists.php.net to get a copy of this message
Note Submitter: rugby7s at gmail dot com ---- I had same problem nickaubert had with trying to compute timestamp for a span of dates that was daylight savings compliant. OLD CODE: /*********************************************** *Note - This is the old code that doesn't handle daylights savings time ***********************************************/ for($i=$start_date; $i<=$end_date; $i=($i+(24*60*60))){ //--- DO something $i is timestamp } NEW CODE: for($i=$start_date;$i<=$end_date; $i=(mktime(0,0,0,date('n',$i),date('d',$i)+1,date('Y',$i)))){ //--- DO something $i is timestamp }

« previous php.notes (#133206) next »