php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28258 mktime error
Submitted: 2004-05-03 07:14 UTC Modified: 2004-05-03 11:58 UTC
From: bichinhoverde at spwinternet dot com dot br Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.6 OS: winxp+apache2 module
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bichinhoverde at spwinternet dot com dot br
New email:
PHP Version: OS:

 

 [2004-05-03 07:14 UTC] bichinhoverde at spwinternet dot com dot br
Description:
------------
I saw a very similar error on another bug report. It was supposed to be fixed but it doesn't seem to be.

mktime fails for dates after 2038 because the long integer type cannot handle such big timestamps.

Reproduce code:
---------------
<?
print mktime(23,59,59,1,18,2038);
print '<br>';
print mktime(23,59,60,1,18,2038);
print '<br>';
print mktime(0,0,0,1,19,2038);
?>

Expected result:
----------------
2147479199
2147479200
2147479200


Actual result:
--------------
2147479199
2147479200

Warning: mktime(): Windows does not support negative values for this function in C:\apacheroot\index.php on line 6
-1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-03 07:28 UTC] bichinhoverde at spwinternet dot com dot br
Sorry, just read on the php documentation:

"on systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038"

"Negative timestamps are not supported under any known version of Windows. Therefore the range of valid years includes only 1970 through 2038."
 [2004-05-03 11:58 UTC] wez@php.net
Wasn't a bug.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jun 01 10:01:26 2025 UTC