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
Which @angular/* package(s) are the source of the bug?
common
Is this a regression?
No
Description
When using the date pipe to transform an ISO-8601 date string, the calculation is affected by Daylight Saving Time in my system time zone, even if I specify an offset.
For example, I am in the "America/Denver" timezone, which observes Daylight Saving Time. I want to display a date in the "America/Phoenix" timezone. During standard time, both time zones, have the same offset, -07:00. But during Daylight Saving Time, "America/Denver" is -06:00 and "America/Phoenix" is -07:00. Using the date pipe to transform a date-time string that occurs exactly at the time when Daylight Saving Time begins, "2024-03-10T02:00:00.000", with the offset specified as -07:00 (to represent Phoenix time), I should see the time as "02:00:00". However, because my system clock is in "America/Denver" time zone, it always skips the time forward to "03:00:00".
I should be able to display a date with an offset, without my system time zone affecting the calculation.
See the linked StackBlitz for examples of date strings that should be formatted correctly but are being affected by Daylight Saving Time calculations.
Please provide a link to a minimal reproduction of the bug
A date string of "2024-03-10T02:00:00.000" is being displayed as "2024-03-10T03:00:00.000", even if I specify an offset of "-07:00" (or whatever the offset is on the system clock where this is being reproduced).
Please provide the environment you discovered this bug in (run ng version)
When date.setMinutes is called, if the resulting date lands between hours 02:00 and 03:00 on March 10, the time is coerced to be on or after 03:00. The reason (as far as I can tell) is that hour doesn't exist, since Daylight Saving Time would kick in and jump everything forward an hour.
Again, this makes no sense when you are trying to display a date in a time zone that does not observe Daylight Saving Time. I should be able to display a date with an arbitrary offset and not have it be affected by my system clock's time zone.
I believe this issue could be resolved by this one: #48279.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Which @angular/* package(s) are the source of the bug?
common
Is this a regression?
No
Description
When using the date pipe to transform an ISO-8601 date string, the calculation is affected by Daylight Saving Time in my system time zone, even if I specify an offset.
For example, I am in the "America/Denver" timezone, which observes Daylight Saving Time. I want to display a date in the "America/Phoenix" timezone. During standard time, both time zones, have the same offset, -07:00. But during Daylight Saving Time, "America/Denver" is -06:00 and "America/Phoenix" is -07:00. Using the date pipe to transform a date-time string that occurs exactly at the time when Daylight Saving Time begins,
"2024-03-10T02:00:00.000"
, with the offset specified as -07:00 (to represent Phoenix time), I should see the time as"02:00:00"
. However, because my system clock is in "America/Denver" time zone, it always skips the time forward to"03:00:00"
.I should be able to display a date with an offset, without my system time zone affecting the calculation.
See the linked StackBlitz for examples of date strings that should be formatted correctly but are being affected by Daylight Saving Time calculations.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-dtm85s
Please provide the exception or error you saw
A date string of
"2024-03-10T02:00:00.000"
is being displayed as"2024-03-10T03:00:00.000"
, even if I specify an offset of"-07:00"
(or whatever the offset is on the system clock where this is being reproduced).Please provide the environment you discovered this bug in (run
ng version
)Anything else?
I stepped through the date pipe code, and I believe this line is the cause:
angular/packages/common/src/i18n/format_date.ts
Line 846 in 950a554
When
date.setMinutes
is called, if the resulting date lands between hours 02:00 and 03:00 on March 10, the time is coerced to be on or after 03:00. The reason (as far as I can tell) is that hour doesn't exist, since Daylight Saving Time would kick in and jump everything forward an hour.Again, this makes no sense when you are trying to display a date in a time zone that does not observe Daylight Saving Time. I should be able to display a date with an arbitrary offset and not have it be affected by my system clock's time zone.
I believe this issue could be resolved by this one: #48279.
The text was updated successfully, but these errors were encountered: