Let say that I have this code:
import sys
from datetime import date time
startDate = datetime.strptime(sys.argv[1], '%d.%m.%Y') # e.g. 05.06.2001 DD.MM.YYYY
endDate = datetime.strptime(sys.argv[2], '%d.%m.%Y') # e.g. 25.05.2005
How to get all the years between these two dates, including start and end year, like
[2001, 2002, 2003, 2004, 2005]
range(startDate.year, endDate.year+1)
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