GMT offsets for ZonedDateTimes have their sign flipped
See original GitHub issueTemporal.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:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No problem, I think it’s a rite of passage to get confused by those zones at some point.
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.