<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 19, 2015 at 5:59 PM, Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div><div>>>> from datetime import datetime</div><div>>>> datetime.strptime("2015-03-08 12:00:00-0500", "%Y-%m-%d %H:%M:%S%z")</div><div>datetime.datetime(2015, 3, 8, 12, 0, tzinfo=datetime.timezone(datetime.timedelta(-1, 68400)))</div></div></div></blockquote><div><br></div></span><div>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.</div><div><br></div><div>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.</div></blockquote></div><br>Good, so you don't have a problem understanding what "2015-03-08 12:00:00-0500" is.  Even thought New Yorkers switched to summer time early morning of March 8, right?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Want to know what time it was in New York?  (Assuming you are not in New York):</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">>>> os.environ['TZ'] = 'America/New_York'</div><div class="gmail_extra">>>> datetime.strptime("2015-03-08 12:00:00-0500", "%Y-%m-%d %H:%M:%S%z").astimezone().isoformat()</div><div class="gmail_extra">'2015-03-08T13:00:00-04:00'</div><div class="gmail_extra"><br></div><div class="gmail_extra">Want to know the same time in Sydney, Australia - be my guest:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">>>> os.environ['TZ'] = 'Australia/Sydney'</div><div class="gmail_extra">>>> datetime.strptime("2015-03-08 12:00:00-0500", "%Y-%m-%d %H:%M:%S%z").astimezone().isoformat()</div><div class="gmail_extra">'2015-03-09T04:00:00+11:00'</div><div class="gmail_extra"><br></div><div class="gmail_extra">If we all understand that '2015-03-08T12:00:00-05:00',  '2015-03-08T13:00:00-04:00' and '2015-03-09T04:00:00+11:00' are different spellings of the same time, where is a bug in the following calculation?</div></div></div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="font-size:12.8000001907349px">>>> print(lt)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">2015-03-07 12:00:00-05:00</span><br></div><div class="gmail_extra"><span style="font-size:12.8000001907349px">>>> lt += timedelta(1)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">>>> print(lt)</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">2015-03-08 12:00:00-05:00</span><span style="font-size:12.8000001907349px"><br></span></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>