Bug #69205 [Com]: DateTime for December 31st fails once every 400 years

From: Date: Wed, 02 Sep 2020 18:20:31 +0000
Subject: Bug #69205 [Com]: DateTime for December 31st fails once every 400 years
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228849@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69205&edit=1 ID: 69205 Comment by: kevin at arcpointgroup dot com Reported by: nd dot wortel at gmail dot com Summary: DateTime for December 31st fails once every 400 years Status: Re-Opened 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: 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. ... Previous Comments: ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ [2018-09-30 14:04:12] cmb@php.net Confirmed: <https://3v4l.org/bDjLn>. Obviously fixed in PHP 7.2+. ------------------------------------------------------------------------ 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

« previous php.bugs (#228849) next »