Bug #77243 [Ver->Csd]: Weekdays are calculated incorrectly for negative years
| From: | git@php.net | Date: | Fri, 17 Jun 2022 08:37:06 +0000 |
| Subject: | Bug #77243 [Ver->Csd]: Weekdays are calculated incorrectly for negative years | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-241748@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77243&edit=1
ID: 77243
Updated by: git@php.net
Reported by: bjoern dot fischer at dezem dot de
Summary: Weekdays are calculated incorrectly for negative
years
-Status: Verified
+Status: Closed
Type: Bug
Package: Date/time related
Operating System: Linux
PHP Version: 7.2.12
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of derickr
Revision: https://github.com/php/php-src/commit/36990aab8eda82984d4c9c7ddaeb2c131b31382c
Log: Fixed bug #77243 (Weekdays are calculated incorrectly for negative years)
Previous Comments:
------------------------------------------------------------------------
[2022-06-09 15:59:04] derick@php.net
https://github.com/php/php-src/pull/8740
------------------------------------------------------------------------
[2022-05-13 16:10:32] derick@php.net
Dan and Christoph are both incorrect.
PHP implements the ISO8601 calendar, which is the Gregorian calendar with the year 0. It supports
timestamps in a 64-bit range, which is well beyond 1900 (like 213 billion years or so).
This indeed looks like a bug.
------------------------------------------------------------------------
[2021-10-01 17:11:24] cmb@php.net
Related To: Bug #78496
------------------------------------------------------------------------
[2020-10-17 13:52:46] cmb@php.net
> Expected: 0000-01-02
There is no year zero in the Gregorian nor the Julian calendar,
though. Consider to use ext/calendar for such purposes.
------------------------------------------------------------------------
[2018-12-05 15:41:23] danack@php.net
From the date page http://php.net/manual/en/function.date.php :
The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038
03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit
signed integer). However, before PHP 5.1.0 this range was limited from 01-01-1970 to 19-01-2038 on
some systems (e.g. Windows).
You may need to use a more specific library to cope with BCE dates, and to do things like deal with
the Julian to Gregorian calendar changes.
------------------------------------------------------------------------
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=77243
--
Edit this bug report at https://bugs.php.net/bug.php?id=77243&edit=1