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
Describe the bug toDate() shifts time by 1 hour. This only happens when I am shifting from summertime (October 31 03:00:00 2021 GMT +2) to wintertime (October 31 02:00:00 2021 GMT +1) in runtime.
The problem stops persisting in runtime at 2021-11-02 02:16:05 +0100.
Current time: Sun Oct 31 2021 02:00:03 GMT+0100 (Central European Standard Time) Input: 21-02-18 00:00:00
constdayjsResult=dayjs(input,format).tz(timeZone);// Wed Feb 21 2018 00:00:00 GMT+0100 (Central European Standard Time)dayjsResult.toDate();// Tue Feb 20 2018 23:00:00 GMT+0100 (Central European Standard Time)
Expected behavior toDate() should have not shifted hours, but instead keep the same datetime
Work around
constdayjsResult=dayjs('21-02-18 00:00:00','DD-MM-YY HH:mm:ss').tz('Europe/Amsterdam');constcorrectDate=newDate(dayjsResult.$d);// Wed Feb 21 2018 00:00:00 GMT+0100 (Central European Standard Time)
I am not sure where the core issue lies and why using the internal getTime() would not be enough for this.
Describe the bug
toDate()
shifts time by 1 hour. This only happens when I am shifting from summertime (October 31 03:00:00 2021 GMT +2) to wintertime (October 31 02:00:00 2021 GMT +1) in runtime.The problem stops persisting in runtime at 2021-11-02 02:16:05 +0100.
Current time: Sun Oct 31 2021 02:00:03 GMT+0100 (Central European Standard Time)
Input: 21-02-18 00:00:00
Expected behavior
toDate()
should have not shifted hours, but instead keep the same datetimeWork around
I am not sure where the core issue lies and why using the internal
getTime()
would not be enough for this.Information
Related
#1805
The text was updated successfully, but these errors were encountered: