php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46732 mktime.year description is wrong
Submitted: 2008-12-02 16:27 UTC Modified: 2008-12-04 13:40 UTC
From: dynkin at gmail dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: PHP 5 OS: linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dynkin at gmail dot com
New email:
PHP Version: OS:

 

 [2008-12-02 16:27 UTC] dynkin at gmail dot com
Description:
------------
Documentation of mktime's year parameter states that

> 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. 

But this part, `70-100 to 1970-2000`, is not precise.

As in the implementation in ext/date/php_date.c::php_mktime,
the doc should read:
"70-110 to 1970-2010", instead of, "70-100 to 1970-2000".


Reproduce code:
---------------
echo date("Y-m-d", mktime(0,0,0,1,1,110));

Actual result:
--------------
2010-01-01

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-02 17:06 UTC] derick@php.net
This is a bug in the code though
 [2008-12-02 18:03 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2008-12-04 13:40 UTC] rquadling@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

The documentation was changed to reflect this "issue". It looks like 
mktime is not actually the culprit here but the timelib/tm2unixtime 
code.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 06:01:28 2024 UTC