darcs patch: Figure out timezone offset from timezone name
David Leuschner
david at loisch.de
Tue Feb 5 07:26:25 EST 2008
> > I just realised I forgot to add a comment in the patch. It's the table
> > from the PostgreSQL manual
> >
> > http://www.postgresql.org/docs/8.1/static/datetime-keywords.html
>
> OK, we should certainly include a link in the source. But why this
> particular set? Where did PostgreSQL get them from?
>
> I Googled and found this:
> http://www.worldtimezone.com/wtz-names/timezonenames.html
> http://www.worldtimezone.com/wtz-names/wtz-vet.html
>
> Venezuela Time certainly has changed offset. The question is, is "VET"
> somehow less standard as an abbreviation than the ones in the PostgreSQL
> list?
The meaning of some abbreviations in specified in RFCs (for example RFC822
defines EST,EDT,CST,CDT,MST,MDT,PST,PDT,GMT and UT).
I think the important point is, that the patch doesn't break anything.
Previously the time module returned wrong time offsets for EVERY timezone
name except UT and GMT. The patch improves on this by returning a time
zone offset that most probably is correct. Due to ambiguity and the
obviously very seldom occuring changes in the meaning of time zone names
(probably the ones in the list won't be affected anyway) the new code
might also return a wrong value. But for all those cases the old code
would have returned a wrong value anyway.
I think it's better to get it right most of the times than to always
return the wrong values. It would be even better if we would return lists
of possible interpretations and let the user decide which interpretation
to choose. But that would require a major API change.
Cheers,
David
--
David Leuschner
Meisenweg 7
79211 Denzlingen
Tel. 07666/912466
More information about the Libraries
mailing list