[Zope] Re: Help with DateTime.earliestTime()

Eric eric at thomasfam.com
Sat Aug 25 08:27:30 EDT 2007


>
> 
> 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.
> 
>  
> Good Example:
> 
> >>> from DateTime import DateTime>>> start=DateTime('2005/10/01 01:00:00 GMT-
5')>>> print start2005/10/01 01:00:00 GMT-5>>> earlyStart=start.earliestTime()
> >>> print earlyStart2005/10/01>>> print earlyStart+312005/11/01
> 
> 
> Bad Example:  (Here's the problem)
> >>> from DateTime import DateTime>>> start=DateTime('2005/10/01 01:00:00 
US/Central')>>> print start2005/10/01 01:00:00 US/Central>>> 
earlyStart=start.earliestTime
> ()>>> print earlyStart2005/10/01>>> print earlyStart+312005/10/31 23:00:00 
US/Central
> I've confirmed this occurs with several of the US/ timezones (US/Pacific, 
US/Alaska, etc)
> Can anyone help me figure out why the resulting date is coming up 1 hour 
short of the expected 2005/11/01 ?
> Thanks!
> Eric
>  
<eric at ...> writes:
Sorry for the oversight...This occurs with zope-2.9.5 and zope-2.9.7
Eric




More information about the Zope mailing list