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


Groups > comp.lang.python > #104826

Re: Missing something about timezones

From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Missing something about timezones
Date 2016-03-14 09:26 -0600
Message-ID <mailman.107.1457969237.12893.python-list@python.org> (permalink)
References <CANc-5UxYPyj85EZfOwGuJarBNj=Ob4mdu7A3Vt4rL8qJhTi+8A@mail.gmail.com>

Show all headers | View raw


On Mon, Mar 14, 2016 at 9:19 AM, Skip Montanaro
<skip.montanaro@gmail.com> wrote:
> Is this correct (today, with Daylight Savings in effect)?
>
>>>> import pytz
>>>> i.timezone
> 'America/Chicago'
>>>> pytz.timezone(i.timezone)
> <DstTzInfo 'America/Chicago' CST-1 day, 18:00:00 STD>
>>>> ot
> datetime.datetime(2016, 3, 14, 9, 30, tzinfo=<DstTzInfo
> 'America/New_York' EDT-1 day, 20:00:00 DST>)
>>>> ot.tzinfo
> <DstTzInfo 'America/New_York' EDT-1 day, 20:00:00 DST>
>
> Shouldn't the America/Chicago timezone reflect DST?

Why should it? You only asked pytz for the Chicago timezone. You
didn't ask for it relative to any specific time.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Missing something about timezones Ian Kelly <ian.g.kelly@gmail.com> - 2016-03-14 09:26 -0600

csiph-web