Re: calculate with date

2005-02-15 Thread Robert Kern
Detlef Jockheck wrote: Hi, I have a date-string given in format "dd.mm.". Now I would like to add 100 days. How can this be solved in python? import datetime def add100days(datestring): day, month, year = [int(x) for x in datestring.split('.')] date0 = datetime.date(year, month, day)

Re: calculate with date

2005-02-15 Thread Fredrik Lundh
Detlef Jockheck wrote: > I have a date-string given in format "dd.mm.". Now I would like to add > 100 days. How can this > be solved in python? >>> from datetime import date, timedelta >>> d = date(2005, 2, 15) >>> d datetime.date(2005, 2, 15) >>> d + timedelta(days=100) datetime.date(2005

calculate with date

2005-02-14 Thread Detlef Jockheck
Hi, I have a date-string given in format "dd.mm.". Now I would like to add 100 days. How can this be solved in python? ciao Detlef -- are you ready - attention - go -- http://mail.python.org/mailman/listinfo/python-list