Skip to content

Is there a reason for showing GMT+1 and not BST? #1041

Answered by icambron
johnend asked this question in Q&A
Discussion options

You must be logged in to vote

Luxon uses the built-into-the-runtime Intl API to get those strings. And annoyingly, the way the data backing that API works, it knows the offset abbreviations for the US if the locale is en-US and the offset abbreviations for the UK if the locale is en-GB:

new Intl.DateTimeFormat("en-US", { timeZoneName: "short", timeZone: "America/New_York"}).format() //=> '10/1/2021, EDT'
new Intl.DateTimeFormat("en-UK", { timeZoneName: "short", timeZone: "America/New_York"}).format() //=> '01/10/2021, GMT-4'
new Intl.DateTimeFormat("en-US", { timeZoneName: "short", timeZone: "Europe/London"}).format() //=> '10/1/2021, GMT+1'
new Intl.DateTimeFormat("en-UK", { timeZoneName: "short", timeZone: "Europe/L…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johnend
Comment options

Answer selected by johnend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants