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
{{ message }}
This repository has been archived by the owner on Jan 26, 2020. It is now read-only.
var ts1 = 1383451200000;
var dt = new timezoneJS.Date(ts1, 'America/New_York');
var ts2 = dt.getTime();
I would expect that ts2 would be equal to ts1 regardless of which timezone I provided, because they are supposed to be UTC. Instead, ts1 is 1383447600000
If I switch to a timezone that doesn't use DST, such as America/Phoenix or Asia/Kolkata then it works as expected.
Or am I wrong in thinking that the input or the output is supposed to be in UTC? The documentation isn't very clear about that. Thanks.
The text was updated successfully, but these errors were encountered:
Your understanding is mostly correct. getTime/setTime works on milliseconds from the Unix epoch. Timezones shouldn't come into it until you try to print out a time in HH:mm:ss format.
There are bugs in timezone-js when you have dates near the DST transitions. It has trouble identifying the correct DST rule to use.
Consider the following:
I would expect that
ts2
would be equal tots1
regardless of which timezone I provided, because they are supposed to be UTC. Instead,ts1
is1383447600000
If I switch to a timezone that doesn't use DST, such as
America/Phoenix
orAsia/Kolkata
then it works as expected.Or am I wrong in thinking that the input or the output is supposed to be in UTC? The documentation isn't very clear about that. Thanks.
The text was updated successfully, but these errors were encountered: