I need the time between two points as integer, to calculate the speed of an object. My first thought was to do it with an datetime object, but I can’t convert it from string to int:
from datetime import datetime
#this is already the right format in HH:MM:SS:MS
d = (datetime.now()).time().isoformat()
coverted = int(d) # not working because of the ":"
i already found an solution here (see below), but the if i print the code, I just get a weird number which doesn't help me at all.
import time
from datetime import datetime
timestamp = int(time.mktime(datetime.now().timetuple())