delta = date1 - date2

and then delta is a timedelta instance. And you reverse it by:

  date2 + delta == date1

Isn't it simple maths? :-)  So be a python lover. It is intuitive and
it won't let you down.

On Jun3, 11:06pm, ceriox <cer...@gmail.com> wrote:
> i'm looking for it but timedelta retun the difference from 2 date ,
> i need to add 30 days to a date
> like my example
> i have a date field and an integer field with the number of days,
> i wanna add the number of days to a data field.
>
> (i'm not an expert pyton programmer)
>
> On 3 Giu, 16:32, Iceberg <iceb...@21cn.com> wrote:
>
>
>
> > Search doc for python built-in timedelta please.
>
> > On Jun3, 10:30pm, ceriox <cer...@gmail.com> wrote:
>
> > > hi,
> > > how i can increment a data field of x days?
>
> > > example
> > > i have
> > > db.Prestiti.Data_richiesta=2010-06-03 16:13:14
> > > db.Prestiti.Durata=30
>
> > > i want generate
> > > fineprestito=2010-07-03 16:13:14
>
> > > i wanna add 30 days to a data field

Reply via email to