vendredi 15 janvier 2021

Generate a random list of n dates in the iso 8601 format within a range in Python

I want to generate a random list of dates in the iso8601 format within the range from 2019-01-01 to 2019-12-31 n times.

from datetime import date
start_date = date(2019,1,1)
end_date = date(2019,12,31)

Other threads I've looked at simply give the list of all dates within that range, but that's not what I need. I also need the dates to be in the iso8601 format. What is the best way to achieve this?




Aucun commentaire:

Enregistrer un commentaire