My script calculate the difference in 2 time. Like this:
lasted = datetime.strptime(previous_time, FMT) - datetime.strptime(current_time, FMT)
You can truncate the seconds when using str by creating a new timedelta object
str
>>> a = datetime.now() >>> b = datetime.now() >>> c = b-a >>> str(c) '0:00:10.327705' >>> str(timedelta(seconds=c.seconds)) '0:00:10'