I write it because I go around every time.
import datetime
#year,month,day,hour,minute,second(,micro?)Is the argument of the datetime method
first_time = datetime.datetime(2013,11,10,11,11,11)
last_time = datetime.datetime(2014,11,10,11,11,11)
delta = last_time - first_time
print delta.total_seconds()
#=>31536000.0 total_Express the difference in seconds using seconds
Recommended Posts