I need to find the next datetime
which is multiple than 5, here is an example:
if the actual time is 12:18
, the variable next
should be 12:20
, if it's 12:20:01
, the variable next
should have the value 12:25
and so on.
Is there any way to do this? Right now i managed to do this:
time = datetime.datetime.now()
min = time.minute
next = 5-(min%5)
print(next)
But this will only count how much time there is until the next multiple of 5. Any advice is appreciated!