I’m looking for a way to count time difference between current time and last full hour. (e.g it’s 11:31 now so it’s 00:31 from 11:00) time.strftime('%H:00:00') returns string 11:00:00 but Im totally clueless what to do next.
>Solution :
time.strftime('%M:00')
You want to get the minutes and don’t care about the hours. So just format the minutes as output. Or perhaps you want to get the minutes from a datetime object as number:
m = datetime.now().minute