You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 'Z' indicates that the ISOString is in Zulu time (UTC). He uses the variant with the timezone offset inside the ISOString for TZDate, which is just as valid as the other format. Furthermore, JavaScript Date does not accept any timezone offsets with seconds; it would be an invalid ISOString.
I actually like TZDate approach more - never really understood why toISOString changes timezone too, but that's how it is... and if TZDate's goal is to be fully compatible, then this should be fixed.
If you don´t like the toISOString() from TZDate, you can use TZDateMini as a workaround. That´s what I use in my project to always return an ISOString with Z.
https://github.com/date-fns/tz/blob/main/src/date/index.js#L29-L30
And there is no seconds, by the way
The text was updated successfully, but these errors were encountered: