# Homework Help: Number of days between two dates

1. Nov 6, 2013

### frank1

1. The problem statement, all variables and given/known data
Find the number of days between (December 8, 1980) and (November 6, 2013).

2. Relevant equations
3. The attempt at a solution

There are 33 years between these two dates (if I get (December 8, 1980) and (December 8, 2013)).

The number of leap years is int(33 / 4) = 8. Hence, I got:

Number of days = (8*366) + (25*365) - (days between November 6, 2013 to December 8, 2013)

days between 12/08/2013 to 06/11/2013 = 24 + 8 = 32

So,

Number of days = (8*366) + (25*365) - 32
Number of days = 2928 + 9125 - 32 = 12021

Well, I checked online ( http://www.timeanddate.com/date/duration.html ) and the right answer is 12.021

EDIT: I got to the answer. Just to check: is that the right way of checking leap years? number of years divided by four?

Last edited: Nov 6, 2013
2. Nov 6, 2013

### UltrafastPED

Count the years - 1981 through 2012 is 32 years. 1984, 1988, 1992, 1996, 2000, 2004, 2008, 2012 are all leap years; so you have 8 extra days. There are 23 days left over in 1980, and 31+28+31+30+31+10= 161 days in 2013.

32*365 + 8 + 23 + 161 = 11,872 days.

The date calculator includes the initial date, but the OP says "between", so it has one day extra.

So between 12/08/1980 to 06/11/2013 there are 11,872 days.

Your "correct answer" has an extra 149 days ... that's about five months, taking you from June to November.
So check that your dates are correct!

3. Nov 6, 2013

### Staff: Mentor

Is 12/08/1980 a date in December or August? In the US we typically write dates in the form MM/DD/YYYY, but in Europe and elsewhere, they usually write them as DD/MM/YYYY.

4. Nov 6, 2013

### UltrafastPED

Good point! I only remember that when I'm in Germany. :-)

5. Nov 6, 2013

### frank1

Oh, I'm sorry, I forgot to use your standard date format.

I edited the original post.

Last edited: Nov 6, 2013
6. Nov 6, 2013

### UltrafastPED

No ... under the current system the year is a leap year if it is divisible by 4, excluding those which are divisible by 100, but including those which are divisible by 400.

So 2000 was a leap year, but 1900 and 2100 are not ...