import datetime
>>> (datetime.datetime.now() - datetime.timedelta(seconds = 300)).strftime("%Y-%m-%d %H:%M:%S.%f")
'2017-06-08 21:08:24.385000'
import datetime
>>> (datetime.datetime.now() - datetime.timedelta(seconds = 300)).strftime("%Y-%m-%d %H:%M:%S.%f")
'2017-06-08 21:08:24.385000'