#36985 [Opn->Bgs]: mktime strange result or leak of documentation
| From: | tony2001@php.net | Date: | Thu, 06 Apr 2006 22:12:58 +0000 |
| Subject: | #36985 [Opn->Bgs]: mktime strange result or leak of documentation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95401@lists.php.net to get a copy of this message | ||
ID: 36985
Updated by: tony2001@php.net
Reported By: fear dot the dot golgota at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux Suse 9.3 professional
PHP Version: 5.0.5
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2006-04-05 17:20:31] derick@php.net
Then I've no idea what is happening, nor can I debug it.
------------------------------------------------------------------------
[2006-04-05 15:51:34] fear dot the dot golgota at gmail dot com
Sorry, my php is 5.0.5
------------------------------------------------------------------------
[2006-04-05 15:42:59] fear dot the dot golgota at gmail dot com
sorry, I can't call date_default_timezone_get(),it's undefined in my
environment!
I can't access the php.ini, or install/update php, I don't have the
permission!
I'm a student working for my thesis!
------------------------------------------------------------------------
[2006-04-05 14:04:07] derick@php.net
what does the following code show:
<?php
echo date_default_timezone_get();
?>
I can not reproduce this here, I get:
828234000<br>828234000<br><br>828237600<br>828237600<br><br>828234000<br>828234000<br><br>828237600<br>828241200<br>
------------------------------------------------------------------------
[2006-04-05 13:56:05] fear dot the dot golgota at gmail dot com
Description:
------------
According to documentation, setting is_dst to -1 can cause unexpected
(but not incorrect) results.
The result below demostrates the behavior of mktime or the
documentation is wrong.
Anyway it's better to explain why the is_dst paramater is deprecated
since php 5.1.0.
I check gmmktime, and the result is the same!
Reproduce code:
---------------
echo (mktime(2,0,0,3,31,1996,1)),"<br>";
echo (mktime(3,0,0,3,31,1996,1)),"<br><br>";
echo (mktime(2,0,0,3,31,1996,0)),"<br>";
echo (mktime(3,0,0,3,31,1996,0)),"<br><br>";
echo (mktime(2,0,0,3,31,1996,-1)),"<br>";
echo (mktime(3,0,0,3,31,1996,-1)),"<br><br>";
echo (gmmktime (2,0,0,3,31,1996)),"<br>";
echo (gmmktime (3,0,0,3,31,1996)),"<br>";
Expected result:
----------------
4 blocks with 2 numbers.
In each block, the pair of numbers must be different!
Actual result:
--------------
828230400
828234000
828234000
828237600
828234000
828234000
828241200
828241200
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36985&edit=1