#22198 [Ana->Csd]: date() returning incorrect date

From: Date: Fri, 06 Aug 2004 21:01:28 +0000
Subject: #22198 [Ana->Csd]: date() returning incorrect date
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969362786@lists.php.net to get a copy of this message
ID: 22198 Updated by: vrana@php.net Reported By: jm at sindigit dot pt -Status: Analyzed +Status: Closed Bug Type: Documentation problem Operating System: Solaris 8 (sparc) PHP Version: 4.3.0 New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "Some times are invalid if DST is on. If DST is enabled in e.g. 2:00, all times between 2:00 and 3:00 are invalid and mktime returns undefined (usually negative) value. Some systems (e.g. Solaris 8) enable DST in midnight so time 0:30 of the day when DST is enabled is evaluated as 23:30 of the previous day." Previous Comments: ------------------------------------------------------------------------ [2004-02-16 10:31:26] php at neworld dot us I am running windows2k, php4.3.4, apache 2.0.48 and I encounter the same issue with this code. <? print mktime(23,0,0,3,27,2004)."\n"; print mktime(0,0,0,3,28,2004)."\n"; ?> Outputs: 1080428400 1080428400 ------------------------------------------------------------------------ [2003-05-17 04:36:29] jim at babylamb dot com I have the same problem running on Mac OS X php -q -r 'print mktime(0,0,0,3,30,2003) . "\n";' -3662 Same happens for 3/31/2003 so is clearly related to DST. ------------------------------------------------------------------------ [2003-03-31 09:40:20] jim dot hatfield at insignia dot com Ditto on FreeBSD 4.7: echo mktime(0, 0, 0, 3, 29, 2003) . "\n"; echo mktime(0, 0, 0, 3, 30, 2003) . "\n"; echo mktime(0, 0, 0, 3, 31, 2003) . "\n"; gives: 1048896000 -3662 1049065200 This from a machine in the UK, where we switched to DST on the date in question. ------------------------------------------------------------------------ [2003-02-21 10:26:47] say_ten at multiplay dot co dot uk I have a very similar problem to this but with much more severe symptoms. sol# php -v PHP 4.3.0 (cli) (built: Feb 1 2003 23:36:25) Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies sol# uname -sr FreeBSD 4.7-STABLE sol# php -q data.php 1048896000 29/03/2003 -3662 31/12/1969 ------------------------------------------------------------------------ [2003-02-13 16:51:35] jm at sindigit dot pt $ zdump -v "Europe/Lisbon" | grep 2003 Europe/Lisbon Sun Mar 30 00:59:59 2003 UTC = Sun Mar 30 00:59:59 2003 WET isdst =0 gmtoff=0 Europe/Lisbon Sun Mar 30 01:00:00 2003 UTC = Sun Mar 30 02:00:00 2003 WEST isds t=1 gmtoff=3600 Europe/Lisbon Sun Oct 26 00:59:59 2003 UTC = Sun Oct 26 01:59:59 2003 WEST isds t=1 gmtoff=3600 Europe/Lisbon Sun Oct 26 01:00:00 2003 UTC = Sun Oct 26 01:00:00 2003 WET isdst =0 gmtoff=0 $ ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22198 -- Edit this bug report at http://bugs.php.net/?id=22198&edit=1

« previous php.doc (#969362786) next »