Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54290 > unrolled thread

Re: Is %z broken for return values of time.gmtime()?

Started byrandom832@fastmail.us
First post2013-09-17 08:48 -0400
Last post2013-09-18 15:01 +0300
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Is %z broken for return values of time.gmtime()? random832@fastmail.us - 2013-09-17 08:48 -0400
    Re: Is %z broken for return values of time.gmtime()? Anssi Saari <as@sci.fi> - 2013-09-18 15:01 +0300

#54290 — Re: Is %z broken for return values of time.gmtime()?

Fromrandom832@fastmail.us
Date2013-09-17 08:48 -0400
SubjectRe: Is %z broken for return values of time.gmtime()?
Message-ID<mailman.65.1379422087.18130.python-list@python.org>
On Mon, Sep 16, 2013, at 16:55, Michael Schwarz wrote:
> On 2013-W38-1, at 19:56, random832@fastmail.us wrote:
> 
> > On Mon, Sep 16, 2013, at 9:15, Michael Schwarz wrote:
> >> According to the documentation of time.gmtime(), it returns a struct_time
> >> in UTC, but %z is replaced by +0100, which is the UTC offset of my OS’s
> >> time zone without DST, but DST is currently in effect here (but was not
> >> at the timestamp passed to gmtime()).
> > 
> > The struct_time type does not include information about what timezone it
> > is in.
> 
> Uhm … Python 3.3 introduced the tm_gmtoff member of struct_time, which
> contains the offset to UTC.

I don't see it. Maybe it is not available on platforms that do not
provide it? Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53)
[MSC v.1600 64 bit (AMD64)] on win32)

I would argue that it _should_ be, and that it should populate it with 0
in gmtime or either with timezone/altzone or by some sort of reverse
calculation in localtime, but it is not. Another problem to add to my
list of reasons for my recent python-ideas proposal.

[toc] | [next] | [standalone]


#54441

FromAnssi Saari <as@sci.fi>
Date2013-09-18 15:01 +0300
Message-ID<vg3d2o4a8z4.fsf@coffee.modeemi.fi>
In reply to#54290
random832@fastmail.us writes:

> I would argue that it _should_ be, and that it should populate it with 0
> in gmtime or either with timezone/altzone or by some sort of reverse
> calculation in localtime, but it is not. Another problem to add to my
> list of reasons for my recent python-ideas proposal.

Docs say that tm_gmtoff and tm_zone are available if the struct tm in
the underlying C library has it. Based on that I kinda expected Cygwin
to have it but apparently not.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web