import datetime
time_posted = datetime.datetime(2013, 3, 31, 12, 55, 10)
timediff = datetime.datetime.now() - time_posted
timediff.total_seconds()
Django: How to get a time difference from the time post?