Q:

randrange python step parameter in minutes

In python , i want to generate a random time between two intervals using randrange function and using the step parameter. I want the time to be generated at 5 minute intervals using randrange. Is it possible? Or is there any other function in python which can achieve the same?
import datetime
import time
import random

start = datetime.datetime(2017,4,25,8,0)
end = datetime.datetime(2017,4,25,11,30)
steptime = datetime.datetime(2017,4,25,0,5)
totalnum=10
start_ts = int(time.mktime(start.timetuple()))
end_ts = int(time.mktime(end.timetuple()))
step = int(time.mktime(steptime.timetuple()))
for val in range(totalnum):
    random_ts = random.randrange(start_ts, 
 end_ts,step)
RANDOMTIME = datetime.datetime.fromtimestamp(random_ts)
print(RANDOMTIME.strftime("%Y-%m-%d %H:%M"))

As mentioned above im not able to find a way to generate time within 5 minute intervals.
TIA

A:

Thanks for the answers. I solved it by providing step as 300 seconds
random_ts = random.randrange(start_ts, end_ts,300)

