Number of days between two dates

  • Thread starter frank1
  • Start date
In summary, the number of days between (December 8, 1980) and (November 6, 2013) is 11,872 days. This calculation takes into account the 33 years between the two dates, including 8 leap years. However, to check the leap years, one must consider the rule that 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.
  • #1
frank1
25
0

Homework Statement


Find the number of days between (December 8, 1980) and (November 6, 2013).

Homework Equations


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:
Physics news on Phys.org
  • #2
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
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
Mark44 said:
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.

Good point! I only remember that when I'm in Germany. :-)
 
  • #5
Oh, I'm sorry, I forgot to use your standard date format.

I edited the original post.
 
Last edited:
  • #6
frank1 said:
Just to check: is that the right way of checking leap years? number of years divided by four?

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 ...
 

Related to Number of days between two dates

What is the formula for calculating the number of days between two dates?

The formula for calculating the number of days between two dates is: number of days = (end date - start date) + 1.

How do I calculate the number of days between two dates using a calendar?

To calculate the number of days between two dates using a calendar, count the number of days from the start date to the end date on the calendar. Make sure to include both the start and end dates in your count. Alternatively, you can use a date calculator tool or a spreadsheet program to automatically calculate the number of days between two dates.

Can I include the start and end dates when calculating the number of days between two dates?

Yes, the start and end dates should be included when calculating the number of days between two dates. The formula for calculating the number of days between two dates already accounts for including both the start and end dates.

How do I calculate the number of weekdays between two dates?

To calculate the number of weekdays (Monday-Friday) between two dates, first calculate the total number of days between the two dates. Then, subtract the number of weekends (Saturday-Sunday) from the total number of days. This will give you the number of weekdays between the two dates.

Can I calculate the number of days between two dates using different time zones?

Yes, you can calculate the number of days between two dates using different time zones. However, make sure to convert the dates to the same time zone before calculating the number of days to ensure accuracy.

Similar threads

  • Programming and Computer Science
Replies
4
Views
1K
Replies
1
Views
985
  • Engineering and Comp Sci Homework Help
Replies
7
Views
6K
  • Programming and Computer Science
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
23
Views
2K
  • Math Proof Training and Practice
3
Replies
93
Views
10K
  • Math Proof Training and Practice
2
Replies
67
Views
10K
  • Astronomy and Astrophysics
Replies
7
Views
1K
  • Cosmology
Replies
4
Views
2K
  • Biology and Medical
9
Replies
287
Views
19K
Back
Top