• + 0 comments
    def time_delta(t1, t2):
        datetime_format = '%a %d %b %Y %H:%M:%S %z'
        datetime_t1 = datetime.strptime(t1, datetime_format)
        datetime_t2 = datetime.strptime(t2, datetime_format)
        datetime_subtract = abs(datetime_t1 - datetime_t2)
        return  str(int(datetime_subtract.total_seconds()))