-
Notifications
You must be signed in to change notification settings - Fork 119
Closed
Description
Hi! Not sure if this is a bug or "intended"/due to some date quirks, but I can't use a year below 100.
zonedTimeToUtc('0100-01-01', 'Europe/Berlin').toISOString()
// === "0099-12-31T23:06:32.000Z"
zonedTimeToUtc('0099-01-01', 'Europe/Berlin').toISOString()
// === "-001801-01-01T23:06:32.000Z"
Metadata
Metadata
Assignees
Labels
No labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
marnusw commentedon Oct 7, 2020
Certainly not intentional. I can't guarantee that I'll be able to look at this any time soon since it seems like quite an edge case. I'd welcome a PR though. You can also check the date-fns library directly to see if they support it, because the
toDate
function was copied from date-fns some versions ago.donaldpipowitch commentedon Oct 7, 2020
Thanks for the quick reply.
make-github-pseudonymous-again commentedon Mar 7, 2022
This bug probably stems from the
Date
constructor.make-github-pseudonymous-again commentedon Mar 7, 2022
Note that there used to be a similar bug in
date-fns
but it has been fixed a long time ago (November 2016).make-github-pseudonymous-again commentedon Mar 9, 2022
I get the following output on runkit (
date-fns
v2.28.0,date-fns-tz
v1.3.0):make-github-pseudonymous-again commentedon Mar 9, 2022
Just wrote a draft PR #170 fixing this issue.
marnusw commentedon Mar 31, 2022
Released in
v1.3.2
.marnusw commentedon Oct 11, 2022