#27533 [Csd]: gmmktime can return wrong value on the night that DST comes into affect

From: Date: Wed, 07 Apr 2004 15:00:58 +0000
Subject: #27533 [Csd]: gmmktime can return wrong value on the night that DST comes into affect
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-57715@lists.php.net to get a copy of this message
ID: 27533 Updated by: derick@php.net Reported By: scottmacvicar at ntlworld dot com Status: Closed Bug Type: Date/time related Operating System: * PHP Version: 4CVS, 5CVS (2004-03-11) New Comment: Please answer all questions, and additionally: which glibc do you have? Previous Comments: ------------------------------------------------------------------------ [2004-04-07 09:38:22] peter at rukavina dot net RedHat Enterprise Linux 3 Kernel 2.4.21-9.0.1.EL PHP 4.3.5 ------------------------------------------------------------------------ [2004-04-07 03:09:09] derick@php.net It works fine for me, what operating system is this on? And in what timezone are you? regards, Derick ------------------------------------------------------------------------ [2004-04-06 17:28:05] peter at rukavina dot net The patch doesn't seem to have solved the problem. Or perhaps it's introduced a new one? Here's a simnple test case that calculates the GMT timestamp using gmmktime, then echos it back using gmstrftime, which should return the SAME time: for ($day = 2 ; $day <= 6 ; $day++) { $datestamp = gmmktime(1,15,0,4,$day,2004); print gmstrftime("%Y-%m-%d %H:%M",$datestamp) . "\n"; } Expected Result: 2004-04-02 01:15 2004-04-03 01:15 2004-04-04 01:15 2004-04-05 01:15 2004-04-06 01:15 Actual Result: 2004-04-02 01:15 2004-04-03 01:15 2004-04-04 03:15 2004-04-05 01:15 2004-04-06 01:15 This only occurs when the datestamp is between 1:00 a.m. and 1:59 a.m. GMT on the day where DST takes effect. ------------------------------------------------------------------------ [2004-03-12 12:23:31] rasmus@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2004-03-12 12:10:16] rasmus@php.net On my Linux box with TZ set to GMT I get: 1080259200 - 26 1080345600 - 27 1080432000 - 28 1080518400 - 29 which appears to me to be correct. But if this patch works around the bug on Windows then I don't see any problem with it. I don't see how it could negatively impact other platforms. ------------------------------------------------------------------------ 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/27533 -- Edit this bug report at http://bugs.php.net/?id=27533&edit=1

« previous php.bugs (#57715) next »