<div>I've been having a site problem that I've tracked down to DateTime. Simply enough, the code snippets below both try to add 31 days to the first day in October. I'm expecting this to result in the first day of November.
</div>
<div> </div>
<div>Good Example:</div>
<div>
<p>>>> from DateTime import DateTime<br>>>> start=DateTime('2005/10/01 01:00:00 GMT-5')<br>>>> print start<br>2005/10/01 01:00:00 GMT-5<br>>>> earlyStart=start.earliestTime()<br>
>>> print earlyStart<br>2005/10/01<br>>>> print earlyStart+31<br>2005/11/01</p></div>
<div>
<p>Bad Example: (Here's the problem)</p>
<p>>>> from DateTime import DateTime<br>>>> start=DateTime('2005/10/01 01:00:00 US/Central')<br>>>> print start<br>2005/10/01 01:00:00 US/Central<br>>>> earlyStart=start.earliestTime
()<br>>>> print earlyStart<br>2005/10/01<br>>>> print earlyStart+31<br>2005/10/31 23:00:00 US/Central</p>
<p>I'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> </p>
<p> </p></div>