time difference interms of day

Jonas H. jonas at lophus.org
Sun Oct 24 14:24:41 EDT 2010


On 10/24/2010 07:55 PM, mukkera harsha wrote:
> On, doing now - startup I want the program to return in terms of days. How ?

 >>> import datetime
 >>> now = datetime.datetime.now()
 >>> after_few_seconds = datetime.datetime.now()
 >>> after_few_seconds - now
datetime.timedelta(0, 14, 256614)
 >>> (after_few_seconds - now).seconds
14

Hope this helps :-)

Jonas



More information about the Python-list mailing list