Closed richardscarrott closed 2 years ago
This is tough edge case for Luxon. The system zone is UTC but to Luxon it's still of type SystemZone
, not FixedOffsetZone
. Luxon doesn't actually know this zone is UTC, it just knows how to ask for offset at a specific time, hence the 00:00. You could equally be in Europe/London and Luxon wouldn't know the difference.
As you hinted, we could potentially fix this by noting that when Luxon formats the name of the system zone, that it returns a string indicating it's UTC, and then overriding the iso formatting, but that's sort of an odd piece of behavior. Needs some thought.
After some thought, I've decided not to fix this. It's annoying and I agree it's a bug, but the fix is too complicated.
Describe the bug In our node.js program the timezone is set to UTC:
We're therefore writing our code using
DateTime.local()
however it generates a different ISO string thanDateTime.utc()
:I know they represent the same moment in time but the latter (with the abbreviated offset
Z
) is what I prefer for our current use case (file names).Is this expected behaviour?
Actual vs Expected behavior
Desktop (please complete the following information):