Re: php's 27/10/2002 problem Important

From: Date: Mon, 16 Sep 2002 14:05:15 +0000
Subject: Re: php's 27/10/2002 problem Important
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-116521@lists.php.net to get a copy of this message
Thank you for your reply, but unfortunately I could not get an important point. I am trying to enumerate x days in a row. So this daylight savings time will be exceptions in the code. Is there any other safe! way to enumarate x days in a row. Thanks in advance Michael Hazelden wrote:
Mahmut, the 27th is the day that daylight savings time ends in both the UK and the USA. You will find two timestamps because on that day there will in fact be 86760 seconds in the day not 86400. I find that using 6am as your timing point (not midnight) will combat this problem. Michael. -----Original Message----- From: Mahmut Kursun [mailto:kursun@bridea.com] Sent: 16 September 2002 14:32 To: php forum Subject: [PHP] php's 27/10/2002 problem Important If you are trying to code a sequantial date requiring algorithm you will see that for 27/10/2002 you have two timestamps!!!! And that is a serious bug I think. Any comments! timestamp : formatted date (d/m/Y) 1035666000 : 27/10/2002 1035752400 : 27/10/2002 P.S. To be able to generate the same output have the following code snippet: <? $timestamp = mktime (0,0,0,10,25,2002); echo "start date is"; echo $timestamp . " : " . strftime('%d/%m/%Y', $timestamp ) . "<br>"; echo "<br>"; echo "&nbsp;&nbsp;timestamp : formatted date"; echo "<br>"; for ($x=1; $x<10; $x++){ $timestamp = $timestamp + 24*60*60; echo $timestamp . " : " . strftime('%d/%m/%Y', $timestamp ) . "<br>"; echo $timestamp . " : " . date('d/m/Y', $timestamp ) . "<br>"; echo "<br>"; } ?>


« previous php.general (#116521) next »