<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 27, 2015 at 12:15 PM, Nikolaus Rath <span dir="ltr"><<a href="mailto:Nikolaus@rath.org" target="_blank">Nikolaus@rath.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Jul 27 2015, Lennart Regebro <<a href="mailto:regebro@gmail.com">regebro@gmail.com</a>> wrote:<br>
> That you add one hour to it, and the datetime moves forward one hour<br>
> in actual time? That's doable, but during certain circumstance this<br>
> may mean that you go from 1AM to<span class="aBn" tabindex="0"><span class="aQJ"> 1AM, or f</span></span>rom 1AM to 3AM.<br>
><br>
> Or do you expect that adding one hour will increase the hour count<br>
> with one, ie that the "wall time" increases with one hour? This may<br>
> actually leave you with a datetime that does not exist, so that is not<br>
> something you can consistently do.<br>
<br>
</span>Apologies for asking yet another dumb question about this, but I have<br>
the impression that a lot of other people are struggling with the basics<br>
here too.<br></blockquote><div><br></div><div>I believe your questions are addressed to Lennart, but let me offer</div><div>my answer to the first:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Can you tell us which of the two operations datetime currently<br>
implements?</blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra">The first one, but not as directly as one might wish.  (I think the situation</div><div class="gmail_extra">is similar to that of pytz's normalize(), but I am not an expert on pytz.)</div><br><div class="gmail_extra">>>> t = datetime(2014,11,2,5,tzinfo=timezone.utc).astimezone()</div><div class="gmail_extra">>>> t.strftime("%D %T%z %Z")</div><div class="gmail_extra">'11/02/14 01:00:00-0400 EDT'</div><div class="gmail_extra">>>> (t+timedelta(hours=1)).astimezone().strftime("%D %T%z %Z")</div><div class="gmail_extra">'11/02/14 01:00:00-0500 EST'</div></div></div>