spacepy.time.randomDate

spacepy.time.randomDate(dt1, dt2, N=1, tzinfo=False, sorted=False)[source]

Return a (or many) random datetimes between two given dates, this is done under the convention dt <=1 rand < dt2

Parameters:

dt1 : datetime.datetime

start date for the the random date

dt2 : datetime.datetime

stop date for the the random date

Returns:

out : datetime.datetime or numpy.ndarray of datetime.datetime

the new time for the next call to EventTimer

Other Parameters:
 

N : int (optional)

the number of random dates to generate (defualt=1)

tzinfo : bool (optional)

maintain the tzinfo of the input datetimes (default=False)

sorted : bool (optional)

return the times sorted (default=False)