Bill Moseley wrote:
>    hour    => 12,  # Assume this exists

This does not always exist.  Africa/Khartoum on 2000-01-15, for example.
In fact, thanks to cases such as Pacific/Apia on 2011-12-30, not only is
there no hour that exists on every day in every zone, there are actually
some zone days for which no hour exists.

>And for the end time of the month (to the second):

Rather than subtract a second and use a <= comparison, it's cleaner to
use the start time of the next month and a < comparison.

>I was thinking of an implementation that assumed DST change happened at an
>hour boundary and simply try incrementing hours until no more exceptions.

That's a bad assumption.  You can assume *minute* boundaries, but
not hours.

-zefram

Reply via email to