Wednesday

October 26, 2016
Posted by **Phillip** on Friday, September 2, 2005 at 12:45pm.

The first thing you need to know is the number of days in each month. If you don't know this little rhyme, I urge you to memorize it.

Thirty days hath September,

April, June, and November.

All the rest have 31,

Except February, which has 28.

So -- in June, you have 30 - 21 (9) days. July and August each have 31 days. You have 23 days in September.

Now just add 9 + 31 + 31 + 23 to find the total number of days between these dates.

Thus, the number of days is 94 because, 31+31=62 & 23+9=32 and so thus adding 62+32=94.

Calculating the number of days between two dates can be done in a relatively simple 3 step process.

Lets examine a specific problem such as find the total number of days between March 16, 2001 and September 25, 2005.

1--First, calculate the number of days between the starting date, i.e., month/day/year, and the exact same month and day of the ending year from Dy = 365(Y2 - Y1) + L where Y2 and Y1 are the ending and starting years respectively and L is the number of leap year days that occur between these two assumed dates.

The total number of days between March 16, 2001 and March 16 2005 is 365(2005 - 2001) + 1 = 1461, there being only 1 leap year day in 2004.

2--Second, having that number, now calculate the number of days between the starting month and date in the ending year and the same date in the final month of the ending year from Dm = 31(M2 - M1) - Ds where M2 and M1 are the numbers representing the ending and starting months respectively and Ds is the number of days that have to be subtracted for that period between the starting and ending dates for those months that have less than 31 days. For this you need only refer to a simple chart as shown below.

Month number..1....2....3.....4.....5.....6....7....8....9....10....11....12

Month...............J....F....M....A....M....J....J....A....S....O.....N.....D

Days.................31..28...31...30...31..30...31..31...30...31...30.....31

In our example, this becomes Dm = 31(9 - 3) - 2 = 184

3--Lastly, you need only calculate the number of days between the final date and the starting date in the final month.

In our example, this becomes d = 25 - 16 = 9.

Therefore, the total number of days between March 16, 2001 and September 25, 2005 becomes 1461 + 184 + 9 = 1654.

If the final month were earlier than the starting month you would have to subtract rather than add the days between non identical months.

You can accomplish this by simply following the expression D = [365(Y2 - Y1) + L] +/- [31(M2 - M1) - Ds] +/- d.

If you were seeking the number of days between September 25, 2001 and March 16, 2005, the calculations would look like this:

D = [356(5 - 1) + 1] - [31(9 - 3) - 2] - (25 - 16) = 1461 - 184 - 9 = 1268.days.