There is also mx.DateTime, which is now free to use, and it is quite easy to handle and more flexible than Python's built-in datetime module for anything. Works in python 2.3+ No * and [0: 6] shenanigans required.
Egenix Download
>>> import mx.DateTime as dt
>>> then = dt.DateTimeFrom(dt.strptime('20040412234551', '%Y%m%d%H%M%S'))
>>> delta = dt.now() - then
>>> delta
<DateTimeDelta object for '2247:13:09:22.31' at 2ab37d666b58>
>>> delta.hours
53941.156198977762
>>> delta.days
2247.5481749574069
source
share