Edit report at https://bugs.php.net/bug.php?id=69205&edit=1
ID: 69205
Updated by: derick@php.net
Reported by: nd dot wortel at gmail dot com
Summary: DateTime for December 31st fails once every 400
years
-Status: Re-Opened
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Ubuntu 14.04
PHP Version: 5.5.22
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
This got fixed in PHP 7.2 already.
Previous Comments:
------------------------------------------------------------------------
[2020-09-02 18:20:31] kevin at arcpointgroup dot com
This appears to be an incorrect implementation of the Gregorian calendar system. Note that years
divisible by 100 are not leap years, but those divisible by 400 are leap years in the Gregorian
calendar.
Running some spot checks on this bug reveals a pattern:
- Years that round up to a value evenly divisible by 400 present this issue.
- Years that round up to a value not evenly divisibly by 400 do not.
Examples:
- 2769 rounds to 2800 (a leap year) and presents the bug.
- 2869 rounds to 2900 (non leap year) and does not present the bug.
- 3169 rounds to 3200 (a leap year) and presents the bug.
- 3269 rounds to 3300 (non leap year) and does not present the bug.
- 3569 rounds to 3600 (a leap year) and presents the bug.
- 3669 rounds to 3700 (non leap year) and does not present the bug.
...
------------------------------------------------------------------------
[2019-05-11 23:44:17] cmb@php.net
You're right. Thanks!
------------------------------------------------------------------------
[2019-05-11 13:31:11] nic at nicwortel dot nl
No, this is still an issue in PHP 7.2+: https://3v4l.org/pj2EK
------------------------------------------------------------------------
[2019-05-11 11:10:00] cmb@php.net
Indeed, still good for all actively supported versions[1].
<https://www.php.net/supported-versions.php>
------------------------------------------------------------------------
[2018-09-30 14:04:48] cmb@php.net
Related To: Bug #67993
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=69205
--
Edit this bug report at https://bugs.php.net/bug.php?id=69205&edit=1