Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Error when parsing date around Daylight Savings Time #14935

Closed
cgledezma1101 opened this issue Apr 4, 2017 · 2 comments
Closed

Error when parsing date around Daylight Savings Time #14935

cgledezma1101 opened this issue Apr 4, 2017 · 2 comments
Labels

Comments

@cgledezma1101
Copy link

cgledezma1101 commented Apr 4, 2017

Hi.

I'm currently running PhantomJS through Chutzpah in VS2017, with my local time zone set to "Canberra, Melbourne, Sydney". It seems though that the engine is having issues when creating dates around the transition between Australian Daylight Time and Australian Standard Time.

The issue is reproducible with a test that does the following:

var result = new Date(2017, 3, 1, 16);
expect(result.getHours()).toBe(16);

This will actually fail, specifying that getHours() returned 17.

The test doesn't fail, nonetheless, when it is run within a browser (Tested in Chrome, FF and IE).

A couple questions, then:

  1. Why is the time being offset on "01/04/2017 16:00" if the offset was actually in effect on "02/04/2017 3:00"
  2. If I don't provide a time zone for the date, shouldn't the engine assume that I need exactly the specified date/time on the current time zone, as opposed to attempting to offset it?

Thanks in advance.

@jedateach
Copy link

jedateach commented Sep 21, 2017

We have seen this same issue recently cause intermittent test failures. We narrowed down the issue with this code:

console.log(new Date(2017, 8, 24));

Displays

  • Sat Sep 23 2017 23:00:00 GMT+1200 (NZST) in PhantomJS 2.1.1
  • Sun Sep 24 2017 00:00:00 GMT+1200 (NZST) in Chrome 61.0.3163.91

@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants