I need to calculate the difference between two dates in python, but always some error.
>>> from datetime import datetime
>>> data1 = datetime(2015, 8, 5, 8, 12, 23)
>>> data2 = datetime(2015, 8, 9, 6, 13, 23)
>>> difdata = data2 - data1
>>> '{0}:{2}'.format(*str(difdata).split())
'3:22:01:00'
I want to do this, but when I try to open in other error systems, I want to create a timestamp with the dates but I'm not getting it.