I have written a program that should find the days between two dates, but it has some hiccups. The logic makes perfect sense in my head when I read through it, so
Reduce all month indexes by 1.
What I mean to say is January will correspond to daysPerMonth[0] or daysPerMonthLeap[0] and not daysPerMonth[1] or daysPerMonthLeap[1].
The reason for this being array indexes start from 0.
So, wherever you are using month1, month2 insidedaysPerMonth[] or daysPerMonthLeap[], use month1-1 and month2-1 instead.
I hope this is clear enough. Otherwise, feel free to comment.