Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not converting to "Australia/Brisbane" timezone correctly #1675

Closed
jevinsidhu opened this issue Mar 16, 2020 · 1 comment
Closed

Not converting to "Australia/Brisbane" timezone correctly #1675

jevinsidhu opened this issue Mar 16, 2020 · 1 comment

Comments

@jevinsidhu
Copy link

jevinsidhu commented Mar 16, 2020

The "Australia/Brisbane" timezone observes Australian Eastern Standard Time (AEST) all year, yet there is discrepancy between March 8th and any date afterward.

Below is an example of this behavior:

const normalDate = new Date("2020-03-09T01:00:00.000");
const daylightDate = new Date("2020-03-08T01:00:00.000");

const utcNormalDate = utcToZonedTime(normalDate, "Australia/Brisbane");
const utcDaylightDate = utcToZonedTime(daylightDate, "Australia/Brisbane");

const formattedNormalDate = format(utcNormalDate, 
  "yyy-MM-dd HH:mm:ssXXX",
  { timeZone: "Australia/Brisbane"});
const formattedDaylightDate =  format(utcDaylightDate,
  "yyy-MM-dd HH:mm:ssXXX",
  { timeZone: "Australia/Brisbane"});

Screen Shot 2020-03-16 at 2 06 12 PM

Here is the code running in a sandbox: https://codesandbox.io/s/competent-frog-z4qkx

@jevinsidhu jevinsidhu changed the title Not converting to "Australia/Brisbane" correctly Not converting to "Australia/Brisbane" timezone correctly Mar 16, 2020
@dcousens
Copy link
Contributor

dcousens commented Mar 16, 2020

@jevinsidhu please see https://github.com/marnusw/date-fns-tz, utcToZonedTime is from that package, not this.

I'd also recommend testing some of the open PR's that might address this issue for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants