<div>I&#39;ve been having a site problem that I&#39;ve tracked down to DateTime.&nbsp; Simply enough, the code snippets below both try to add 31 days to the first day in October.&nbsp; I&#39;m expecting this to result in the first day of November.
</div>
<div>&nbsp;</div>
<div>Good Example:</div>
<div>
<p>&gt;&gt;&gt; from DateTime import DateTime<br>&gt;&gt;&gt; start=DateTime(&#39;2005/10/01 01:00:00 GMT-5&#39;)<br>&gt;&gt;&gt; print start<br>2005/10/01 01:00:00 GMT-5<br>&gt;&gt;&gt; earlyStart=start.earliestTime()<br>
&gt;&gt;&gt; print earlyStart<br>2005/10/01<br>&gt;&gt;&gt; print earlyStart+31<br>2005/11/01</p></div>
<div>
<p>Bad Example:&nbsp; (Here&#39;s the problem)</p>
<p>&gt;&gt;&gt; from DateTime import DateTime<br>&gt;&gt;&gt; start=DateTime(&#39;2005/10/01 01:00:00 US/Central&#39;)<br>&gt;&gt;&gt; print start<br>2005/10/01 01:00:00 US/Central<br>&gt;&gt;&gt; earlyStart=start.earliestTime
()<br>&gt;&gt;&gt; print earlyStart<br>2005/10/01<br>&gt;&gt;&gt; print earlyStart+31<br>2005/10/31 23:00:00 US/Central</p>
<p>I&#39;ve confirmed this occurs with several of the US/ timezones (US/Pacific, US/Alaska, etc)</p>
<p>Can anyone help me figure out why the resulting date is coming up 1 hour short of the expected 2005/11/01 ?</p>
<p>Thanks!</p>
<p>Eric</p>
<p>&nbsp;</p>
<p>&nbsp;</p></div>