Entry
Is there an easy way to increment the month or year of the DateTime object?
Jul 29th, 2000 22:12
unknown unknown, Jim Sanford
Problem:
Adding a numeric value increments the day. Incrementing the year is
easily doable, but incrementing the month is significantly more
difficult. So I'm just curious if there's a function that will actualy
modify the parts of a DateTime object, or something way that I'm not
thinking of to easily increment the month.
Solution:
<dtml-var
"_.DateTime(_.str(ZopeTime().month()+1)+'/'+_.str(ZopeTime()
.day())+'/'+_.str(ZopeTime().year()))">
will give you a datetime object one month in the future