question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GMT offsets for ZonedDateTimes have their sign flipped

See original GitHub issue

Temporal.Now.zonedDateTimeISO("Etc/GMT+2"); Saves as: “Temporal.ZonedDateTime <2021-09-10T17:33:37.680174947+02:00[Etc/GMT-2]>” So if we use zonedTimeISO.toLocaleString("en-gb") we get: 10/09/2021, 17:33:37 GMT+2

rather than: 10/09/2021, 13:33:37 GMT-2

This only seems to be an issue with “Etc/GMT±<offset>” so functions as expected for timezones such as “London/Europe”

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gilmoreorlesscommented, Sep 11, 2021

No problem, I think it’s a rite of passage to get confused by those zones at some point.

0reactions
khemscommented, Sep 11, 2021

That’s brilliant, thank you for taking the time to explain even though the implementation was correct, and I just lacked the knowledge! Definitely the opposite of what I expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is java 8 time not showing me the correct ... - Stack Overflow
The best solution is to use time zones rather than a mere offset. An offset is simply a number of hours-minutes-seconds. A time...
Read more >
Temporal.ZonedDateTime - TC39
For historical reasons, signs are reversed between these time zones' names and their offsets. For example, Etc/GMT+8 would be used for cases where...
Read more >
Time Zone and Offset Classes (The Java™ Tutorials > Date ...
It is used to represent time (hour, minute, second, nanosecond) with an offset from Greenwich/UTC time (+/-hours:minutes, such as +06:00 or -08:00).
Read more >
Date/Time Functions - Documentation - Safe Software
Type Flag Meaning Year %Y Four‑digit year, with range 0001 to 9999. Year %y Two‑digit year. Month %m Two‑digit month, with range 01 to 12.
Read more >
Setting the Time Zone - Thales Docs
Note: If you choose to enter GMT plus-or-minus a numeric offset, please note that zone names beginning with "Etc/GMT" have their signs reversed....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found