Let's say I have two input dates of the format dd/mm/yyyy. The first is the current date and the second is the future date. I have methods getDay, getMonth, and getYear, which return to me integer values for day, month and year. I have another method called isLeapYear, that checks whether or not a particular year is a leap year or not (The criteria that it uses is that the year must be a multiple of 4 and for century years, the year must also be a multiple of 400 for it to be a leap year), and returns a true or false.
I know that this is somewhat of a computer science question, but the math underneath it is relevant here. How do I devise a formula that calculates the number of days between two dates? I had the idea that I could perhaps perhaps find the number of days from a fixed date A to the current date, then the number of days from A to the future date, and then subtract the difference, but i'm not sure exactly how I would do that?
I thought of using 00/00/0000 as the fixed date but i'm not sure if that makes sense. Would I consider the year 0000 to be a leap year or not? Any hints would be appreciated