darcs patch: Figure out timezone offset from timezone name

Bjorn Bringert bjorn at bringert.net
Sun Feb 3 17:25:08 EST 2008


On Feb 2, 2008 9:17 PM, Bjorn Bringert <bjorn at bringert.net> wrote:
> On Feb 2, 2008 8:49 PM, Duncan Coutts <duncan.coutts at worc.ox.ac.uk> wrote:
> >
> > On Sat, 2008-02-02 at 11:36 -0800, Don Stewart wrote:
> > > david:
> > > > Sat Feb  2 12:33:17 CET 2008  David Leuschner <david at loisch.de>
> > > >   * Figure out timezone offset from timezone name
> > >
> > > This should be forwarded to the time library maintainer, Bjorn Bringert.
> >
> > If that is the case then he should probably update the email address
> > that darcs uses:
> >
> > http://darcs.haskell.org/packages/time/_darcs/prefs/email
> >
> > It is currently set to this list.
> >
> > Duncan
>
> I also thought that Ashley Yakeley was the maintainer. I have written
> the code that this patch concerns though. The patch seems nice, but
> there are some problems:
>
> - Time zone information is not static.
> - Time zone names are sometimes ambiguous.
>
> Shouldn't we really use the OS time zone database for this?

David and I have discussed this, and it seems like this hard-coded
timezone database is in any case better than the current incorrect
behavior. In the majority of cases it will do the right thing, instead
of being almost always incorrect as it is now. I have pushed the patch
now, but there are some improvements that could be made:

- There are no test cases that test this. The Arbitrary TimeZone
instance in test/TestParseTime.hs doesn't generate time zone names, so
time zone name handling doesn't get tested.

- The timezone table is rather long, and uses plain 'lookup'. OTOH,
introducing a dependency on the 'containers' package seems excessive
just to do faster lookup.

/Bjorn


More information about the Libraries mailing list