find time difference in seconds as an integer with python

Viewed 104370

I need to find the time difference in seconds with python. I know I can get the difference like this:

from datetime import datetime
now = datetime.now()
....
....
....
later = datetime.now()
difference = later-now

how do I get difference in total seconds?

4 Answers
Related