#36985 [Opn]: mktime strange result or leak of documentation
| From: | derick@php.net | Date: | Wed, 05 Apr 2006 17:20:31 +0000 |
| Subject: | #36985 [Opn]: mktime strange result or leak of documentation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95355@lists.php.net to get a copy of this message | ||
ID: 36985
Updated by: derick@php.net
Reported By: fear dot the dot golgota at gmail dot com
Status: Open
Bug Type: Date/time related
Operating System: Linux Suse 9.3 professional
PHP Version: 5.0.5
New Comment:
Then I've no idea what is happening, nor can I debug it.
Previous Comments:
------------------------------------------------------------------------
[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