I need to append random hours to date field. For this I used following code:
datetime.utcnow().date() + relativedelta(hours=random.randint(0,23))
This returned response:
datetime.date(2018, 7, 5)
Above response is not reproducible. Wondering if using random.randint() is reliable. Please let me know what caused this to occur or what other solution I can use for this problem.
Aucun commentaire:
Enregistrer un commentaire