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
if you look at the diff for pull request #220 (tests only, all currently passing), you can see the current behaviour of zonedTimeToUtc when the time is set to a zoned time which doesn't exist (because the clock jumps forward and skips that hour)
it('handles times that dont exist with clock jump forward: -ve UTC offset',function(){// at 02:00 local clock will immediately jump forward to 03:00varresult=zonedTimeToUtc('2023-03-12T02:00:00','America/New_York')// UTC 06:59 is NY 01:59 GMT -5// UTC 07:00 is NY 03:00 GMT -4// !! this is an error - should either throw error OR return UTC 07:00// it should NOT return 06:00 but defining problem before making tests failassert.deepEqual(result.toISOString(),'2023-03-12T06:00:00.000Z')})
as per the comments in the above test - I believe if set to 02:00, returning the UTC time which corresponds to 1 hour prior to moving the clock forward is a mistake, and should either return UTC @ the moment the clock had ticked over from 01:59 or throw an error.
The text was updated successfully, but these errors were encountered:
mcshaz
changed the title
Handling of
Handling of zonedTimeToUtc when zoned time is during daylight saving jump forward is 1 hour before
Jan 12, 2023
mcshaz
changed the title
Handling of zonedTimeToUtc when zoned time is during daylight saving jump forward is 1 hour before
Handling of zonedTimeToUtc when zoned time is during daylight saving jump forward is 1 hour too early
Jan 12, 2023
if you look at the diff for pull request #220 (tests only, all currently passing), you can see the current behaviour of zonedTimeToUtc when the time is set to a zoned time which doesn't exist (because the clock jumps forward and skips that hour)
as per the comments in the above test - I believe if set to 02:00, returning the UTC time which corresponds to 1 hour prior to moving the clock forward is a mistake, and should either return UTC @ the moment the clock had ticked over from 01:59 or throw an error.
The text was updated successfully, but these errors were encountered: