This might help… the website http://mathforum.org/library/drmath/view/66857.html suggests this method. I tried it with a couple dates and a calculator and it worked:
First of all, since February is an especially short month, it is
normally better to consider January and February the 13th and 14th
months of the previous year. So first, if the month is 1 or 2, then
you add 12 to the month and subtract 1 from the year. Then the day is
365 * year + year/4 - year/100 + year/400 + date + (153 * month+8)/5
where all of the divisions are rounded DOWN to the nearest integer.
Do this for both dates, and subtract.