php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3092 mktime returns error value (-1) for some value of year
Submitted: 2000-01-03 12:57 UTC Modified: 2000-01-08 06:28 UTC
From: piarrech dot crepin at publicis-technology dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.9 OS: solaris
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: piarrech dot crepin at publicis-technology dot com
New email:
PHP Version: OS:

 

 [2000-01-03 12:57 UTC] piarrech dot crepin at publicis-technology dot com
mktime(0,0,0,$mm,$dd,$YYYY) returns -1 (error) if $YYYY is inferior to 1901 or superior to 2039.

use of function date("Y", mktime(0,0,0,$mm,$dd,$YYYY))
with there values returns 1970.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-01-08 06:28 UTC] sas at cvs dot php dot net
The observed behaviour is correct. You can use mktime only for dates between the beginning of the epoch (1970) and the implementation limit (2038).
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Oct 09 22:00:02 2026 UTC