how do i add the minutes between two dates to a closed list?

Try:

from datetime import datetime, timedelta

start_date = datetime(2020, 1, 1, 1, 0)
end_date = datetime(2020, 1, 1, 3, 0)

dates_range = []
while start_date < end_date:
    dates_range.append(start_date) # or you can append str(start_date) if want the dates to be as strings
    start_date += timedelta(minutes=1)

print(dates_range)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top