Need help in finding out the number of days between two dates.

Mac07

New member
Joined
Sep 26, 2014
Messages
2
suppose the two dates are 13/10/1992 and 26/9/2014 , the number of days will be ?
Actually im trying to solve questions on Calendar .
Please help..
 
Last edited:
All "non-leap" years have 365 days while leap years have 366 days (surely you knew that?). And leap years are those divisible by 4. The leap years between 1992 and 2014 are 1996, 2000, 2004, 2008, and 2012. So there are 4 leap years- how many days are there in those years? There are 22- 4= 18 non-leap years. How many days are there in those years? Now, how many days are there between Oct 13, 1992 to the end of the year? How many days are there from the beginning of 2014 to Sept. 26, 2014.

(Thirty days has September, April, June, and November. All the rest except for February, have 31 days. February of 2014 had 28 days since 2104 is NOT a leap year.)
 
Days Between Dates

suppose the two dates are 13/10/1992 and 26/9/2014 , the number of days will be ?
Actually im trying to solve questions on Calendar .
Please help..

How can you calculate the total number of days between two dates.

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.



Tchrwill
 
And leap years are those divisible by 4. <--------- It's somewhat more complicated than that rule.

...since 2104 <-------- This is a typo. It should be "2014."
is NOT a leap year.)

Which Years are Leap Years?

In the Gregorian calendar 3 criteria must be taken into account to identify leap years:

  • The year is evenly divisible by 4;
  • If the year can be evenly divided by 100, it is NOT a leap year, unless;
  • The year is also evenly divisible by 400. Then it is a leap year.
This means that 2000 and 2400 are leap years, while 1800, 1900, 2100, 2200, 2300 and 2500 are NOT leap years.

Source:
http://www.timeanddate.com/date/leapyear.html
 
suppose the two dates are 13/10/1992 and 26/9/2014 , the number of days will be ?
Actually im trying to solve questions on Calendar .
Please help..

If you have access to MS-excel - you can subtract one date from the other. The answer is 8018 (excel takes care of leap-year and such).
 
Hello,

I am trying to do the same thing, but need to do a calculation after the number of days are calculated, so I was wondering if I needed to put this calculation into a field type first. If so, do I need to create an integer type field first, and then put this logic onto the calculation section of the integer field?

Thanks!

Betina
 
need to do a calculation after the number of days are calculated … wondering if I [need] to put this calculation into a field type first
Hello. Can you provide an example for the type(s) of calculation in which the number of days will be used? Are you talking about Excel (or some other software)?
[imath]\;[/imath]
 
Top