In <[EMAIL PROTECTED]>, Lad wrote:

> In a datetime object I would like to change days and hours.
> Or in other words, I would like to copy this datetime object but
> increase days and hours.
> Is it possible?
> For example:If I have a datetime object like this
> datetime.datetime(2006, 8, 3, 14, 13, 56, 609000)
> 
> I would like to make a new ,for example like this
> 
> datetime.datetime(2006, 8, 12, 10, 13, 56, 609000)
> 
> is it possible to do so?

Yes it is, just add a `timedelta` object:

In [18]: a = datetime.datetime(2006, 8, 3, 14, 13, 56, 609000)

In [19]: a + datetime.timedelta(days=8, hours=20)
Out[19]: datetime.datetime(2006, 8, 12, 10, 13, 56, 609000)

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to