-
Notifications
You must be signed in to change notification settings - Fork 120
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
zonedTimeToUtc is not working for timeZone Etc/GMT+6 #33
Comments
Please see if you can get this time zone to work with
This library was designed for use with |
Thanks, sorry I am using I've tried: var date = new Date(Date.UTC(2019, 11, 26, 10, 0, 0));
var expectedResult = Intl.DateTimeFormat(undefined, {
'Etc/GMT+6'
}).format(date); It throws the error: Now I believe the BTW Moment.js handles |
Facing same problem. Any solution? |
@marnusw I tried to do this Here is the
which understands the timezone and returns 2/12/2020, 6:05:31 PM |
zonedTimeToUtc('2019-11-26T10:00:00', 'America/Chicago');
// returns correct 2019-11-26T16:00:00.000ZzonedTimeToUtc('2019-11-26T10:00:00', 'Etc/GMT+6');
// returns incorrect 2019-11-26T10:00:000Z, timezone Etc/GMT+6 is silently ignored. Nor Unsupported time zone specified is thrown. It should return too 2019-11-26T16:00:00.000Z. It's Central Standard Time (CST).Etc/GMT+6 is correct timezone identification by IANA database https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
findTimeZone('Etc/GMT+6')
fromrequire('timezone-support')
confirming that timezone exists.zonedTimeToUtc
is not working generally with timezones 'Etc/GMT+X'.Versions:
date-fns-tz: v.1.0.8
date-fns: v.2.8.1
The text was updated successfully, but these errors were encountered: