
I am trying to figure out how to use this library, seems like this should work Prelude Data.Time.ZoneInfo> ctx <- newContext Nothing Prelude Data.Time.ZoneInfo> name <- zoneInfoName (utcOlsonZone ctx) True Prelude Data.Time.ZoneInfo> newOlsonZone ctx name *** Exception: Data.Time.ZoneInfo.newOlsonZone: invalid argument (Invalid argument) but it doesn't, neither does Prelude Data.Time.ZoneInfo> newOlsonZone ctx "America/New_York" *** Exception: Data.Time.ZoneInfo.newOlsonZone: invalid argument (Invalid argument) and my zoneinfo seems to be kosher on my machine $ ls /usr/share/zoneinfo/America/New_York /usr/share/zoneinfo/America/New_York $ ls /usr/share/zoneinfo/GMT /usr/share/zoneinfo/GMT what am i missing?

passing a full path seems to work, despite the fact that the documentation says
newContext :: Maybe String -> IO ContextSource
Create a Context object. A path to the zone-info database may be
specified. Otherwise, the TZDIR environment variable, or a reasonable
default, will be used. An IOError will be thrown on failure.
On Wed, Oct 20, 2010 at 10:40 PM, Anatoly Yakovenko
I am trying to figure out how to use this library, seems like this should work
Prelude Data.Time.ZoneInfo> ctx <- newContext Nothing Prelude Data.Time.ZoneInfo> name <- zoneInfoName (utcOlsonZone ctx) True Prelude Data.Time.ZoneInfo> newOlsonZone ctx name *** Exception: Data.Time.ZoneInfo.newOlsonZone: invalid argument (Invalid argument)
but it doesn't, neither does
Prelude Data.Time.ZoneInfo> newOlsonZone ctx "America/New_York" *** Exception: Data.Time.ZoneInfo.newOlsonZone: invalid argument (Invalid argument)
and my zoneinfo seems to be kosher on my machine
$ ls /usr/share/zoneinfo/America/New_York /usr/share/zoneinfo/America/New_York
$ ls /usr/share/zoneinfo/GMT /usr/share/zoneinfo/GMT
what am i missing?

Anatoly Yakovenko wrote:
I am trying to figure out how to use this library, seems like this should work Data.Time.ZoneInfo...
Have you looked at my timezone-olson package? I wrote it as an alternative to Data.Time.ZoneInfo. I think it is more flexible, and better integrated with Data.Time. Thanks, Yitz
participants (2)
-
Anatoly Yakovenko
-
Yitzchak Gale