php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1876 date() function returns Dec-1969 for years below 1902.
Submitted: 1999-07-26 09:40 UTC Modified: 1999-07-26 15:52 UTC
From: joel at joelryan dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.7 OS: Debian
Private report: No CVE-ID: None
 [1999-07-26 09:40 UTC] joel at joelryan dot com
The following line reproduces the problem.

echo date('M-Y',mktime(0,0,0,1,1,1901))

This line works correctly.

echo date('M-Y',mktime(0,0,0,1,1,1902))


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-26 15:52 UTC] rasmus at cvs dot php dot net
This is a limitation of your system.  Your system problem uses 32-bit integer to represent
times and this you can only handle dates that are 1970 +- 68 years.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 12:00:01 2026 UTC