[Datetime-SIG] Visualizing the DST transitions
carl at oddbird.net
Wed Oct 21 23:42:26 CEST 2015
On 10/21/2015 03:27 PM, Alexander Belopolsky wrote:
> I just wanted to share a slide
>  I came across that is very similar to the sketches in PEP 495. Does
> anyone understand how CCTZ handles the discontinuities?
It provides two APIs, MakeTime and MakeTimeInfo, which both accept a
"naive datetime" and a timezone.
MakeTime returns an absolute time, and discontinuities are handled by
always assuming the pre-transition offset:
MakeTimeInfo returns a more complex TimeInfo struct which has a `kind`
enum member that can be `UNIQUE` (the normal case), `SKIPPED`, or
`REPEATED`, and has `pre`, `post`, and `trans` timestamp members
(containing the time calculated using the pre-transition offset, the
time calculated using the post-transition offset, and the time at which
the transition occurs), which in the normal case of `UNIQUE` are all set
to the same value. Documentation starts here:
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: OpenPGP digital signature
More information about the Datetime-SIG