I have a list of Dates returning Mondays between two dates
mondays =[datetime.date(2019, 2, 14), datetime.date(2019, 2, 21)]
How do I format this list to %Y%m%d format?
Expecting output list to be in the below format:
['20190214','20190221']
is there a way?
the following will work
[date_obj.strftime('%Y%m%d') for date_obj in mondays]
Output
['20190214', '20190221']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With