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
constdayjs=require('dayjs');dayjs.extend(require('dayjs/plugin/utc'));dayjs.extend(require('dayjs/plugin/timezone'));// On March 13, 2022 in America/Montreal, at 2:00am, we roll the time back by 1 hour.// This is the exact millisecond when that happens:constdstBoundary=1647154800000;// This should obviously be true, and it is.console.log(dayjs.tz(dstBoundary-1,'America/Montreal').valueOf()===dstBoundary-1);// This should also obviously be true, but it is false. :(console.log(dayjs.tz(dstBoundary,'America/Montreal').valueOf()===dstBoundary);
Expected behavior
When explicitly setting the time as a value in ms since the epoch, dayjs should not change the time we set, but here it does, rewinding time by one hour. 1647154800000 and 1647151200000 are two very different times.
Information
Day.js Version: v1.10.8
OS: MacOS
Browser: node v16.14.0
Time zone: America/Montreal
The text was updated successfully, but these errors were encountered:
Describe the bug
Expected behavior
When explicitly setting the time as a value in ms since the epoch, dayjs should not change the time we set, but here it does, rewinding time by one hour.
1647154800000
and1647151200000
are two very different times.Information
The text was updated successfully, but these errors were encountered: