git.iko.soy/typeable/timezone-olson
on master help sign in
Round tz offset to the nearest minute rather than truncate.
commit9e3ec733cf9344aef1f6c1d0ddd5ea252f995be3 authorYitzchak Gale <gale@sefer.org> dateSun 16 May 2010, 12:56 (16 years ago) parent8b572aa
1 file changed+2−1
Data/Time/LocalTime/TimeZone/Olson/Parse.hs+2−1
Data/Time/LocalTime/TimeZone/Olson/Parse.hs+2−1
@@ -88,7 +88,8 @@ olsonToTimeZoneSeries (OlsonData ttimes ttinfos@(dflt0:_) _ _) =
8888 where
8989 dflt = fromMaybe dflt0 . listToMaybe $ filter isStd ttinfos
9090 isStd (TtInfo _ isdst _ _) = not isdst
91− mkTZ (TtInfo gmtoff isdst _ abbr) = TimeZone (gmtoff `div` 60) isdst abbr
91+ mkTZ (TtInfo gmtoff isdst _ abbr) =
92+ TimeZone ((gmtoff + 30) `div` 60) isdst abbr
9293 lookupTZ ttinfos ttime = fmap (((,) $ toUTC ttime) . mkTZ) . listToMaybe $
9394 drop (transIndex ttime) ttinfos
9495 toUTC = posixSecondsToUTCTime . fromIntegral . transTime