ID: 29065 Updated by: [EMAIL PROTECTED] Reported By: ehavet at yahoo dot fr -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Linux 2.4.16C12 PHP Version: 4.3.6 New Comment:
We are happy to tell you that you just discovered Daylight Savings Time. For more information see: http://webexhibits.org/daylightsaving/b.html Instead of using mktime/date consider using gmmktime and gmdate which do not suffer from DST. Previous Comments: ------------------------------------------------------------------------ [2004-07-08 18:49:43] ehavet at yahoo dot fr Description: ------------ When you want to display each 10/31/Year plus 1 day, you've got sometimes 10/31/Year instead of 11/01/Year. Noticed on PHP 4.3.3 (ISP linux server) and PHP 4.3.6 (WinXP personal system) Getting the date with date("m/d/Y", mktime(0,0,0,10,31,$i)+(24*3600)); gives the same result exept for 11/1/1993 Reproduce code: --------------- <?php for ($i = 1990 ;$i < 2011 ; $i++) { $date = getdate(mktime(0,0,0,10,31,$i)+(24*3600)); echo $date['mon']."/".$date['mday']."/".$date['year']."\n"; } ?> Expected result: ---------------- 11/1/1990 11/1/1991 11/1/1992 11/1/1993 11/1/1994 11/1/1995 11/1/1996 11/1/1997 11/1/1998 11/1/1999 11/1/2000 ... Actual result: -------------- 11/1/1990 11/1/1991 11/1/1992 10/31/1993 11/1/1994 11/1/1995 11/1/1996 11/1/1997 11/1/1998 10/31/1999 11/1/2000 11/1/2001 11/1/2002 11/1/2003 10/31/2004 11/1/2005 11/1/2006 11/1/2007 11/1/2008 11/1/2009 10/31/2010 11/1/2011 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29065&edit=1