I am able to create date randomly but I want to create date by giving the time range as well.
Here is the code for creating date randomly,
import pandas as pd
import numpy as mp
def random_dates(start, end, n=10000):
start_u = start.value//10**9
end_u = end.value//10**9
return pd.to_datetime(np.random.randint(start_u, end_u, n), unit='s')
start = pd.to_datetime('2019-01-01 07:00:00')
end = pd.to_datetime('2019-09-30 23:59:00')
X = random_dates(start, end)
df = pd.DataFrame(X, columns=['date'])
But Timerange is not working.