Get n seconds before the target time. See Example Test Cases about the format.
from dateutil import parser
import datetime

def seconds_ago(s,n):
    timej = parser.parse(s) - datetime.timedelta(seconds=n)
    return  str(timej)
from dateutil import parser
import datetime

def seconds_ago(s,n):
    timej = parser.parse(s) - datetime.timedelta(seconds=n)
    return  str(timej)