#27719 [Opn->Csd]: mktime returns incorrect timestamp for dst days
| From: | derick@php.net | Date: | Tue, 30 Mar 2004 12:42:52 +0000 |
| Subject: | #27719 [Opn->Csd]: mktime returns incorrect timestamp for dst days | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-57105@lists.php.net to get a copy of this message | ||
ID: 27719
Updated by: derick@php.net
Reported By: schmidt dot a at rogers dot com
-Status: Open
+Status: Closed
Bug Type: Date/time related
Operating System: FreeBSD 4.4
PHP Version: 5.0.0RC1
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2004-03-26 14:50:12] schmidt dot a at rogers dot com
problem fixed. thanks.
------------------------------------------------------------------------
[2004-03-26 14:25:25] rasmus@php.net
I have committed a fix which uses the 4am offset instead of 2 there
around line 192 in datetime.c. Any chance you could test that and let
me know if it fixes your problem?
------------------------------------------------------------------------
[2004-03-26 14:00:40] rasmus@php.net
I made the changed referenced above to address this bug:
http://bugs.php.net/27533
Perhaps the solution here is to offset it to +3 or +4 instead to get
the baseline timestamp.
------------------------------------------------------------------------
[2004-03-26 13:39:51] schmidt dot a at rogers dot com
Ok I've done some more testing, FreeBSD mktime will return -1 when
passed in 2 am for the day when clocks are being moved ahead, since
2am should never exist.
I'm not sure how linux handles this (maybe returns a 3am timestamp).
This coupled with the change to ext/standard/datetime.c line 192+ which
always changes the hour 2am if its 12 or 1 am. Unfortunatly this has a
bad effect of messing up 12am and 1am for daylight savings days which
are valid hours.
http://cvs.php.net/diff.php/php-src/ext/standard/datetime.c?r1=1.116&r2=1.117&ty=h
I'm not sure what the best solution is, but I hope this helps.
------------------------------------------------------------------------
[2004-03-26 12:13:44] schmidt dot a at rogers dot com
I tested it out on FreeBSD 5.2.1 and still had the same problem using
the latest snapshot:
[GD:andrew] ~ (1) > uname -a
FreeBSD my.domain 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Mon Feb 23
20:45:55 GMT 2004
root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC i386
[GD:andrew] ~ (2) > php -v
PHP 5.0.0RC2-dev (cgi) (built: Mar 26 2004 12:19:53)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0RC2-dev, Copyright (c) 1998-2004 Zend Technologies
[GD:andrew] ~ (3) > php test_mktime.php
Content-type: text/html
X-Powered-By: PHP/5.0.0RC2-dev
-7262
-7262
-7262
------------------------------------------------------------------------
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/27719
--
Edit this bug report at http://bugs.php.net/?id=27719&edit=1