A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/298725.html below:

another time challenge

another time challenge another time challengeEddie Corns eddie at holyrood.ed.ac.uk
Thu Sep 29 07:27:54 EDT 2005
nephish at xit.net writes:

>Hey there pythoneers

>i have another question about time, specifically, the mxDateTime
>module.
>i have been able to get a RelativeDateTimeDiff between two times,
>it gives me a difference between two DateTimes in the form of +3days
>+2hours etc...

>so, if i have a date that is 6 days and 6 hours from another day,
>it will give me Days+6, hours+5.

>what i need is something like 6.4 days or close to it.
>is there an easy way to convert this ?

>if not i can write up something to do the math.

>i guess i am just looking for a cleaner shortcut.

You could extract the hours,mins,secs part to a DateTimeDelta which supports
float() and just divide that into 86400.0.

Eddie

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4