start_date = '07_Nov_2011'
end_date = '10_Jan_2012'
I want to print all the intermediate dates in the same format:
day_month_year
If I can somehow convert start_date to date type I can do this:
sdate+timedelta(1)).strftime('%d_%b_%Y')
How do I convert it? Or is there a better way to do this?
You can use
datetime.datetime.strptime(...)to do the conversion. Like this:You can print all the intermediate dates with something like this: