#27719 [Opn]: mktime returns incorrect timestamp for dst days
| From: | schmidt dot a at rogers dot com | Date: | Fri, 26 Mar 2004 17:13:45 +0000 |
| Subject: | #27719 [Opn]: mktime returns incorrect timestamp for dst days | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56895@lists.php.net to get a copy of this message | ||
ID: 27719
User updated by: schmidt dot a at rogers dot com
Reported By: schmidt dot a at rogers dot com
Status: Open
Bug Type: Date/time related
Operating System: FreeBSD 4.4
PHP Version: 5.0.0RC1
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2004-03-26 11:54:30] schmidt dot a at rogers dot com
I tried it out, and still got the same problem:
[as:andrew] ~/public_html (104) # php -v
PHP 5.0.0RC2-dev (cli) (built: Mar 26 2004 12:00:30)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0RC2-dev, Copyright (c) 1998-2004 Zend Technologies
[as:andrew] ~/public_html (105) # php test_mktime.php
-7262
-7262
-7262
------------------------------------------------------------------------
[2004-03-26 11:33:54] derick@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
It works fine for me on LInux (with RC2-dev); perhaps you can try the
latest PHP 5 snapshot?
------------------------------------------------------------------------
[2004-03-26 11:31:49] schmidt dot a at rogers dot com
I should mention it worked fine in php 5 beta 4 as well.
------------------------------------------------------------------------
[2004-03-26 11:27:42] schmidt dot a at rogers dot com
Description:
------------
As of php 5.0RC1 mktime returns a negative value when supplied with a
date on daylight savings regardless of the is_dst option.
This did not occur in php 5 beta 3, nor in any version of php 4.
Reproduce code:
---------------
echo mktime(0, 0, 0, 4, 4, 2004, 0) . "\n";
echo mktime(0, 0, 0, 4, 4, 2004, 1) . "\n";
echo mktime(0, 0, 0, 4, 4, 2004, -1) . "\n";
Expected result:
----------------
with php 5 beta 3 and php 4:
1081054800
1081051200
1081054800
Actual result:
--------------
with php 5 RC1:
-7262
-7262
-7262
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27719&edit=1