php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47470 mktime fails for dates > 2038
Submitted: 2009-02-22 02:09 UTC Modified: 2009-02-22 19:07 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: mb at smartftp dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.8 OS: Windows 2008 64-bit
Private report: No CVE-ID: None
 [2009-02-22 02:09 UTC] mb at smartftp dot com
Description:
------------
mktime fails for dates > 2038.

Reproduce code:
---------------
<?php

if(mktime(0,0,0, 1, 1, 2039) === FALSE)
{
	print "mktime failed";
}
?>

Expected result:
----------------
No output

Actual result:
--------------
mktime failed

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-22 17:49 UTC] crrodriguez at opensuse dot org
http://en.wikipedia.org/wiki/Year_2038_problem
 [2009-02-22 18:03 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 [2009-02-22 19:03 UTC] mb at smartftp dot com
Your documentation says otherwise:

Reference: http://ch.php.net/mktime

year 
The number of the year, may be a two or four digit value, with values between 0-69 mapping to 2000-2069 and 70-100 to 1970-2000. 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. However, before PHP 5.1.0 this range was limited from 1970 to 2038 on some systems (e.g. Windows).
 [2009-02-22 19:07 UTC] mb at smartftp dot com
On Windows time_t is defined as a 64-bit integer. Therefore the valid range is > 2038.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 21:01:33 2024 UTC