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
Context
I used getTimeZones() function. For the above timezone(America/Matamoros), currentTimeOffsetInMinutes returns -360.
As you could see here that we had a DST on Sunday, March 13, 2022. So now it's UTC-5.
Question
Shouldn't it return -300 for currentTimeOffsetInMinutes?
Also the respective currentTimeFormat string is wrong. It's showing -06:00 ... instead of -05:00 ...
The text was updated successfully, but these errors were encountered:
Hey there @parekh-raj, this is unfortunate. I've dug into this issue many times and here's how it works:
tzdb (this package) does an Intl.DateTimeFormat call to get the current time zone information for a zone. This call itself then use any version of the timezone database available inside Node.js.
So it really depends how up-to-date your Node.js version is. And even that, the latest Node.js version (17.7.2) is not completely up to date with the latest tzdata version (lagging two versions behind).
I am not sure there's a way to solve this easily. Maybe @eblokhin since you touched a bit on this subject you have some thoughts?
Please correct me if I'm wrong. 😇
I took an example of timezone America/Matamoros.
Context
I used
getTimeZones()
function. For the above timezone(America/Matamoros),currentTimeOffsetInMinutes
returns -360.As you could see here that we had a DST on
Sunday, March 13, 2022
. So now it's UTC-5.Question
Shouldn't it return -300 for
currentTimeOffsetInMinutes
?Also the respective
currentTimeFormat
string is wrong. It's showing-06:00 ...
instead of-05:00 ...
The text was updated successfully, but these errors were encountered: