Closed mattjohnsonpint closed 4 years ago
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.
I think this used to work though. See #78
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.