You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just (TimeZoneRef tzLabel) ->pure$TZI.fromLabel tzLabel
Just (OffsetRef offset) ->pure$ tzInfoFromOffset offset
Just (TimeZoneAbbreviationRef abbrev) ->pure$ tzInfoFromOffset $ abbrev.tzaiOffsetMinutes
Just (UnknownTimeZoneAbbreviationRef unknownAbbrev) ->Left unknownAbbrev
However, as the haddocks state, this uses the IANA database embedded inside the tzdata package:
Timezone rules are constantly getting updated and, unless we constantly upgrade the tzdata dependency to the latest version, eventually we'll be using old timezone rules, leading to wrong conversions.
Clarification and motivation
At the moment, we're using
Data.Time.TZInfo.fromLabel
to fetch the timezone rules for some given timezone.tzbot/src/TzBot/TimeReference.hs
Lines 140 to 146 in 4c2315e
However, as the haddocks state, this uses the IANA database embedded inside the
tzdata
package:Timezone rules are constantly getting updated and, unless we constantly upgrade the
tzdata
dependency to the latest version, eventually we'll be using old timezone rules, leading to wrong conversions.Instead, we should use the operating system's timezone database, using
Data.Time.TZInfo.loadFromSystem
.Note:
loadFromSystem
will not work on Windows. We should document that the server cannot run on Windows.fromLabel
on windows, but if there's no need to support windows, then it's not worth doing)The text was updated successfully, but these errors were encountered: