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
keepLocalTime flag does NOT work correctly at .tz("America/Los_Angeles", true). See No.5 below.
Note that, in LA, March 13 was the day to switch from STD to DST at 2022.
constdayjs=require("dayjs");dayjs.extend(require("dayjs/plugin/utc"));dayjs.extend(require("dayjs/plugin/timezone"));// #1 - OKdayjs("2022-03-13T01:59:59Z").utc().format();// => '2022-03-13T01:59:59Z'// #2 - OKdayjs("2022-03-13T01:59:59Z").utc().tz("America/Los_Angeles",true).format();// => '2022-03-13T01:59:59-08:00'// #3 - OKdayjs("2022-03-13T01:59:59Z").utc().tz("America/Los_Angeles",true).tz("America/Los_Angeles").format();// => '2022-03-13T01:59:59-08:00'// #4 - OK. It's 3 o'clock.dayjs("2022-03-13T03:00:01Z").utc().format();// => '2022-03-13T03:00:01Z'// #5 - NG. It's 4 o'clock NOT 3. keepLocalTime does not work. Incorrect time zone offset.dayjs("2022-03-13T03:00:01Z").utc().tz("America/Los_Angeles",true).format();// actual => '2022-03-13T04:00:01-08:00' // expected => '2022-03-13T03:00:01-07:00'// #6 - NG. It's 5 o'clock. Time zone offset is correct.dayjs("2022-03-13T03:00:01Z").utc().tz("America/Los_Angeles",true).tz("America/Los_Angeles").format();// actual => '2022-03-13T05:00:01-07:00'// expected => '2022-03-13T03:00:01-07:00'
Expected behavior
keepLocalTime should work. Correct time zone offset -07:00.
Describe the bug
keepLocalTime
flag does NOT work correctly at.tz("America/Los_Angeles", true)
. See No.5 below.Note that, in LA, March 13 was the day to switch from STD to DST at 2022.
Expected behavior
keepLocalTime
should work. Correct time zone offset-07:00
.Information
America/Los_Angeles
and any other DST switching areas.The text was updated successfully, but these errors were encountered: