469,328 Members | 1,327 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

How to find out a date/time difference

Lad
I use datetime class in my program and now
I have two fields that have the datetime format like this
datetime.datetime(2006, 5, 24, 16, 1, 26)

How can I find out the date/time difference ( in days) of such two
fields?
Thank you for help?
L

May 24 '06 #1
2 4524
Convert datetime.datetime(2006, 5, 24, 16, 1, 26) to an ordinal number
like:
datetime.datetime(2006, 5, 24, 16, 1, 26).toordinal()
and subtract them to get number of days.

May 24 '06 #2
Lad skrev:
How can I find out the date/time difference ( in days) of such
two fields?


Did you try to subtract one value from the other?

Mvh,

--
Klaus Alexander Seistrup
SubZeroNet, Copenhagen, Denmark
http://magnetic-ink.dk/
May 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jon Davis | last post: by
5 posts views Thread by Geoff Jones | last post: by
17 posts views Thread by Justin Emlay | last post: by
6 posts views Thread by Scott | last post: by
3 posts views Thread by bbawa1 | last post: by
5 posts views Thread by Konstantinos Pachopoulos | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.