[Datetime-SIG] Are there any "correct" implementations of tzinfo?
random832 at fastmail.com
Mon Sep 14 21:13:16 CEST 2015
On Mon, Sep 14, 2015, at 14:53, Tim Peters wrote:
> So, on your own machine, whenever daylight time starts or ends, you
> manually change your TZ environment variable to specify the newly
> appropriate eternally-fixed-offset zone? Of course not.
No, but the hybrid zone isn't what gets attached to the individual
struct tm value when you convert a time from utc (or from a POSIX
timestamp) to a timezone local value. A single fixed utc offset is
(along with the name and, yes, isdst flag).
And pytz doesn't involve manually changing anything, it involves (as
best it can) automatically applying the value to attach to each
individual datetime value.
> A datetime object is the Python spelling of a C struct tm, but never
> included the tm_isdst flag.
And no-one behind this proposal seems to be contemplating adding an
equivalent to tm_gmtoff, despite that it would serve the same
disambiguation purpose and make it much cheaper to maintain global
invariants like a sort order according to the UTC value (No, I don't
*care* how that's not how it's defined, it is *in fact* true for the UTC
value that you will ever actually get from converting the values to UTC
*today*, and it's the only total ordering that actually makes any sense)
More information about the Python-list