DateTime.toFormat('ZZZZ') not showing expected output
See original GitHub issueAccording to the docs, when the ‘ZZZZ’ token is passed in the format string, the abbreviated named offset string should be displayed in the output string. However, the timezone offset from GMT is being displayed instead.
Code snippet to test the issue:
DateTime.fromISO("2019-05-03T10:59:22Z")
.setZone("America/Los_Angeles")
.toFormat('dd-MMM-yy hh:mm:ss ZZZZ');
Expected Output:
03-May-19 03:59:22 PDT
Actual Output:
03-May-19 03:59:22 GMT-7
Package Version: ^1.13.0
Environments: node@12.1.0
, Chrome
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
DateTime.toFormat('ZZZZ') not showing expected output (Again)
Previously an issue #499 has raised itself again. To recap: According to the docs, when the ZZZZ token is passed in the format...
Read more >Where's the DateTime 'Z' format specifier? - Stack Overflow
I'm confused because I know 'Z' isn't supported according to MSDN, but the exception asks me to use it. And I what I...
Read more >Timestamps, Time Zones, Time Ranges, and Date Formats
Learn how Sumo Logic manages timestamps, time zones, time ranges, and dates, and the configuration options that are available.
Read more >Convert a Field to a Date Field - Tableau Help
Create a calculation using the DATE function. If the DATEPARSE function is not available for the data that you're working with, or the...
Read more >Cannot format ISO datetime string in TRIRIGA Platform 3.5.2.3
Unable to format ISO datetime string in IBM TRIRIGA Platform 3.5.2.3 to provide a ... 6) As you can see below, it's not...
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
I’m getting the same issue on MacOS Big Sur while running tests in Jest on Node 16.3.
ZZZZ
returnsGMT+2
(expectedCEST
)ZZZZZ
returnsCentral European Summer Time
I have the same results using Firefox 81.0 on the same OS. For a non-DST date (i.e. in the winter), it returns
GMT+1
orCET
respectively.