Eric, on 2007-08-26:
> To work around this, I've modified the addition so that instead of adding 1 
> day, it adds 1.5 days.  This extra half a day is removed by the 
> theDateTime.earliestTime() call but is enough to overcome the DST addition 
> problem. Ugly hack.

I had the same problem once in the eXtremeManagement Plone product.
For a monthly overview I needed to do something for every day of the
month.  I worked around it with the code below.

    day = 1
    date = DateTime(2007, 10, 1) # 1 October 2007
    while True:
        # skipped some lines irrelevant to the DateTime problem
        day += 1
            date = DateTime(self.year, self.month, day)

Hm, that should probably be "except DateTime.DateTime.DateError" but
there is not really anything else that can go wrong here.

Maurits van Rees | [NL]
            Work |
"Do not worry about your difficulties in computers,
 I can assure you mine are still greater."

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to