Closed lesichkovm closed 7 months ago
After testing, in golang, 0001-01-01 00:00:00+0000 GMT
is a zero value, but 0000-01-01 00:00:00+0000 GMT
or 0002-01-01 00:00:00+0000 GMT
is not
This looks very wrong. According to AI:
"0000-01-01 00:00:00" is not a valid date according to the most common date and time standards. Here's why:
Year Zero Doesn't Exist: Our calendar system doesn't have a year zero. There was no year 0 between 1 BC and 1 AD.
We should add support for '0001-01-01 00:00:00' to Carbon, as it is a valid datetime, and can be saved in i.e. MySQL. For instance, when getting the data from the database it reads as '0001-01-01 00:00:00', but once it is passed into Carbon it gets blank.
After testing, in golang,
0001-01-01 00:00:00+0000 GMT
is a zero value, but0000-01-01 00:00:00+0000 GMT
or0002-01-01 00:00:00+0000 GMT
is not
Your tests will pass if you update the time layout:
After testing, in golang,
0001-01-01 00:00:00+0000 GMT
is a zero value, but0000-01-01 00:00:00+0000 GMT
or0002-01-01 00:00:00+0000 GMT
is notYour tests will pass if you update the time layout:
The layout does not match the time string,the layout contains a time zone, but the time string does not
Sorted by using 0002-01-01 00:00:00 which is the earliest valid date
V2.3.11 has been optimized and released
Hello,
I encountered an issue with the following code:
golang version: 1.22 (latest)
carbon version: 2.3.10 (latest)
time zone: GMT
I expected to get:
But I actually get:
Example of issue: https://play.golang.com/p/L6HDUXlCDEz
How it is supposed to work:
Thanks!