usually you would do: from datetime import timedelta db.event.fromdate<=request.now + timedelta(hours=24*30*2)
but it would not be precise and timedelta does not support months. You wil have to write your own function def plus_two_months(da): (y,m,d)=(da.year,da.month,da.day) m+=2 if m>12: m=m-12 y+=1 return datetime.date(y,m,d) db.event.fromdate <= plus_two_months(request.now) On Jun 15, 9:13 am, annet <annet.verm...@gmail.com> wrote: > Massimo, > > Thanks, something else though, how do I increase request.now by 2 > months? > > db.event.fromdate<=request.now + 2 months > > Kind regards, > > Annet. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---