Bug #78496 [Asn->Dup]: date_create rolls a day back on year 0000 timestamp

From: Date: Fri, 01 Oct 2021 17:11:24 +0000
Subject: Bug #78496 [Asn->Dup]: date_create rolls a day back on year 0000 timestamp
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236978@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78496&edit=1 ID: 78496 Updated by: cmb@php.net Reported by: dzuczek at dlc-solutions dot com Summary: date_create rolls a day back on year 0000 timestamp -Status: Assigned +Status: Duplicate Type: Bug Package: Date/time related Operating System: Linux PHP Version: 7.2.22 -Assigned To: derick +Assigned To: cmb Block user comment: N Private report: N New Comment: > ISO 8601 defines the year zero as the year 1 BC in the Gregorian > calendar. Oh, right. They also say that "values in the range [0000] through [1582] shall only be used by mutual agreement of the partners in information interchange." Anyhow, this is a duplicate of bug #77243. Previous Comments: ------------------------------------------------------------------------ [2021-02-08 05:01:41] justinpor119 at gmail dot com The date was parsed in UTC (GMT) because you provided a date-only string without any time zone indicator. If you had given a date/time string w/o an indicator instead (new Date("2011-09-24T00:00:00")), it would have been parsed in your local timezone. ------------------------------------------------------------------------ [2020-04-17 06:31:54] alexanderpas at gmail dot com This also affects getting a timestamp out of a DateTime object created with a timestamp. (Where the output should always be the same as the input) See https://bugs.php.net/bug.php?id=78499 which has some additional testcases. ------------------------------------------------------------------------ [2019-09-05 23:41:52] alexanderpas at gmail dot com ISO 8601 defines the year zero as the year 1 BC in the Gregorian calendar. The last few days in January are also affected. ------------------------------------------------------------------------ [2019-09-05 22:12:03] requinix@php.net Related To: Bug #78499 ------------------------------------------------------------------------ [2019-09-05 16:47:38] cmb@php.net Well, actually there is no year 0 in the Gregorian calendar. ------------------------------------------------------------------------ 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=78496 -- Edit this bug report at https://bugs.php.net/bug.php?id=78496&edit=1

« previous php.bugs (#236978) next »