[Haskell-cafe] Towards a better time library (announcing tz)

Mihaly Barasz klao at nilcons.com
Mon Apr 7 16:20:19 UTC 2014

On Mon, Apr 7, 2014 at 6:08 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
> On Mon, Apr 7, 2014 at 11:49 AM, Mihaly Barasz <klao at nilcons.com> wrote:
>> * a module which contains all of the time zones shipped in a pure way.
> I have to admit that I strongly dislike this idea. What happens when someone
> changes timezone rules? (Which happens quite often, actually.)

I intend to maintain this library, so the latest version always have
up-to-date zone information. Also, see Renzo's proposal to have this
in a separate package with a versioning scheme that closely reflects
the version of the tz data shipped. (I think it's a sensible idea and
I will do this when/if what I have actually satisfies his needs).

And also, you don't _have to_ use this. `tz` also has a `loadSystemTZ`
function, which will read the appropriate file from
/usr/share/zoneinfo (or whereever the TZDIR envvar points to), and
then you can use the result in the (pure) utcToLocalTimeTZ and
localTimeToUTCTZ conversion functions. This would be exactly like what
happens in a C program if you run it with TZ envvar set to that


> --
> brandon s allbery kf8nh                               sine nomine associates
> allbery.b at gmail.com                                  ballbery at sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

More information about the Haskell-Cafe mailing list