moment / luxon

⏱ A library for working with dates and times in JS
https://moment.github.io/luxon
MIT License
15.23k stars 730 forks source link

Etc/GMT-6 | Etc/GMT-5 timezones work exactly opposite. Instead of decreasing the time it increases it. #1450

Closed SaudQureshi1997 closed 1 year ago

SaudQureshi1997 commented 1 year ago

Etc/GMT-6 should subtract 6 hours from UTC and display something like: Luxon version: ^3.3.0 Node Version: 15.14.0

UTC DateTime:
2023-06-16T10:00:00.000+00:00
Etc/GMT-6:
2023-06-16T02:00:00.000-06:00

Where as:

Etc/GMT-6 displays:
2023-06-16T16:00:00.000+06:00

Code:

const dateTime = DateTime.fromJSDate(
  new Date("2023-06-16T10:00:00.000+00:00")
).setZone("Etc/GMT-6");
console.log({
  dateTime: dateTime.toString(),
})
diesieben07 commented 1 year ago

The Etc/GMT zones are opposite of what you would expect. Etc/GMT-6 is 6 hours ahead of UTC. See here.