php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36985 mktime strange result or leak of documentation
Submitted: 2006-04-05 13:56 UTC Modified: 2006-04-06 22:12 UTC
From: fear dot the dot golgota at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.0.5 OS: Linux Suse 9.3 professional
Private report: No CVE-ID: None
 [2006-04-05 13:56 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-05 14:04 UTC] 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 15:42 UTC] 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 15:51 UTC] fear dot the dot golgota at gmail dot com
Sorry, my php is 5.0.5
 [2006-04-05 17:20 UTC] derick@php.net
Then I've no idea what is happening, nor can I debug it.
 [2006-04-06 22:12 UTC] tony2001@php.net
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 05:01:33 2025 UTC