[Zope] Date

Tom Deprez tom.deprez@uz.kuleuven.ac.be
Wed, 22 Nov 2000 10:54:29 +0100


Hum, but then you also have to take into account the possible year change.
But a nice idea.

Tom.

At 23:17 21/11/2000 +0100, Dieter Maurer wrote:
>Tom Deprez writes:
> > Does someone knows how to calculate the date after 6 months of a
certain date?
> > 
> > eg ZopeTime() + 6 months?
> > 
> > Is there an easy formula for this? Or do I've to check myself for a new
> > year, leap year
>When I would need it (and did not find a better method),
>I would use (in an external method):
>
>  1. convert to a Python time tuple
>  2. add 6 to the month component (creating a new tuple)
>  3. convert back to a DateTime object.
>
>It might be necessary to normalize the time tuple
>before 3. with an "time.localtime(time.mktime(tup))".
>
>
>Dieter
>
>