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
My system time zone is America/Los_Angeles, where the start of daylight saving time on 2023-03-12 jumped the local time directly from 01:59 (-08:00) to 03:00 (-07:00). The UTC time zone had no such jump, of course, so one wouldn’t expect any issues formatting a UTC date between 01:59 (Z) and 03:00 (Z) for display in UTC.
However, because formatInTimeZone works internally by converting the time in the given zone to a “corresponding” local time in the system zone, this doesn’t work.
>formatInTimeZone(newDate('2023-03-12T01:05Z'),'UTC','Pp z')'03/12/2023, 1:05 AM UTC'>formatInTimeZone(newDate('2023-03-12T02:05Z'),'UTC','Pp z')// expected 2:05 AM UTC'03/12/2023, 3:05 AM UTC'>formatInTimeZone(newDate('2023-03-12T03:05Z'),'UTC','Pp z')'03/12/2023, 3:05 AM UTC'>formatInTimeZone(newDate('2023-03-12T04:05Z'),'UTC','Pp z')'03/12/2023, 4:05 AM UTC'
(Using [email protected] on Node.js 20.9.0 with America/Los_Angeles as the system time zone.)
The text was updated successfully, but these errors were encountered:
My system time zone is
America/Los_Angeles
, where the start of daylight saving time on 2023-03-12 jumped the local time directly from 01:59 (-08:00) to 03:00 (-07:00). TheUTC
time zone had no such jump, of course, so one wouldn’t expect any issues formatting aUTC
date between 01:59 (Z) and 03:00 (Z) for display inUTC
.However, because
formatInTimeZone
works internally by converting the time in the given zone to a “corresponding” local time in the system zone, this doesn’t work.(Using [email protected] on Node.js 20.9.0 with
America/Los_Angeles
as the system time zone.)The text was updated successfully, but these errors were encountered: