[Datetime-SIG] PEP-0500 (Alternative datetime arithmetic) Was: PEP 495 ... is ready ...

Chris Barker chris.barker at noaa.gov
Wed Aug 19 23:59:38 CEST 2015

On Wed, Aug 19, 2015 at 2:47 PM, Alexander Belopolsky <
alexander.belopolsky at gmail.com> wrote:

>    Note that the term "time zone" does not have the common meaning of a
>    region of the world at a specific UTC offset, possibly modified by
>    daylight saving time.

sigh -- tangled up in semantics again. we really need a glossary!

No, but only because this is already part of the standard library:
> >>> from datetime import datetime
> >>> datetime.strptime("2015-03-08 12:00:00-0500", "%Y-%m-%d %H:%M:%S%z")
> datetime.datetime(2015, 3, 8, 12, 0,
> tzinfo=datetime.timezone(datetime.timedelta(-1, 68400)))

semantics again -- this does indeed create an "aware" timezone, one with a
tzinfo object with a fixed offset -- which is what ISO 8601 says it means.

But anyway, I think we've only gotten tangled up in semantics here -- I
haven't seen anything proposed about this that I have a problem with.



Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150819/5de4bd33/attachment-0001.html>

More information about the Datetime-SIG mailing list