#26917 [Opn->Bgs]: Incorrect date returned by date()

From: Date: Thu, 15 Jan 2004 11:33:36 +0000
Subject: #26917 [Opn->Bgs]: Incorrect date returned by date()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-53374@lists.php.net to get a copy of this message
ID: 26917 Updated by: derick@php.net Reported By: paul at mileham dot net -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Windows 2000 PHP Version: 4.3.4 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. DST Previous Comments: ------------------------------------------------------------------------ [2004-01-15 06:25:45] paul at mileham dot net Description: ------------ date() returns Saturday 27th March 2004 instead of Sunday 28th March 2004. mktime is OK.We have a diary with two consecutive Saturdays - hoorah! Reproduce code: --------------- // this proves there's a bug in php dates!! for($i=1;$i<32;$i++) { $monnum=3; $year=2004; $date2= date('D jS F Y',mktime(0,0,0,$monnum,$i,$year)); $d3=mktime(0,0,0,$monnum,$i,$year); echo "<br>".$date2; echo $d3; } Expected result: ---------------- Each date correct Actual result: -------------- Two Saturdays and no Sunday ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26917&edit=1

« previous php.bugs (#53374) next »