Skip to content

How to tell if a timezone has DST? #1172

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

You must be logged in to vote

Unfortunately, the only way is to probe some dates and see if they have different offsets. Luxon users a similar trick to implement isInDST()

Luxon doesn't actually have access to the time zone rules, so it doesn't have a way to tell you that from the zone itself. isUniversal, as you saw, can only know if it can't have a DST because the zone declares itself that way, so it works with fixed-offset zones that Luxon supports directly. For an IANA-specified zone, it might or might not have a DST, and Luxon will get the times right regardless, but it's unaware of the DST as a standalone fact.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by PaulAtST
Comment options

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

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