[Python-ideas] Reduce platform dependence of date and time related functions

random832 at fastmail.us random832 at fastmail.us
Wed Sep 18 00:30:39 CEST 2013


On Tue, Sep 17, 2013, at 17:21, Alexander Belopolsky wrote:
> On Tue, Sep 17, 2013 at 4:58 PM, <random832 at fastmail.us> wrote:
> >
> > You can also determine gmtoff empirically by calling timegm and
> > subtracting the original timestamp from the result. Or you could look at
> > the seconds, minutes, hours, year, and yday members after calling both
> > gmtime and localtime in the first place.
> 
> 
> How is this different from what we do in datetime.astimezone()?

Not very different at all, except for the fact where I want the
functionality in struct_time to populate tm_gmtoff and tm_zone where
it's not available.

My goal is to normalize the functionality available on all platforms, to
the extent that it's possible, so that people are less likely to write
non-portable code and encounter example code that doesn't work.


More information about the Python-ideas mailing list