php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #44593 strtotime conflicting definitions of 2 digit years
Submitted: 2008-04-01 13:42 UTC Modified: 2008-11-05 16:34 UTC
From: bernhard at bksys dot at Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
 [2008-04-01 13:42 UTC] bernhard at bksys dot at
Description:
------------
http://www.php.net/manual/en/function.strtotime.php says:

"Note: If the number of the year is specified in a two digit format, the values between 00-69 are mapped to 2000-2069 and 70-99 to 1970-1999."

This makes 69 2069. 0035 should be the ancient year 35 AD.

"time
The string to parse, according to the GNU ? Date Input Formats syntax."

http://www.gnu.org/software/tar/manual/html_node/tar_115.html says:

-------------------------
72-9-24        # Assume 19xx for 69 through 99,
               # 20xx for 00 through 68.

If year is 68 or smaller, then 2000 is added to it; otherwise, if year is less than 100, then 1900 is added to it.
-------------------------

This makes 69 1969. 0035 is less than 69 so should be converted to 2035.




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-05 16:34 UTC] vrana@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

We don't use GNU anymore, it is being documented by #36474.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Jun 14 03:00:01 2026 UTC