Post Reply 
Year(s) Month(s) Day(s) between 2 dates
10-23-2015, 04:38 PM
Post: #22
RE: Year(s) Month(s) Day(s) between 2 dates
Hi,

I'm going be clear. In my algorithm think like as follow :

First : numbers of days : in feb 1951 are 28 days (year not leap). I count then 28-23 = 5 days.
In sep 1999 are 5 days (in our example).

For me I have 10 days.

Second : numbers of full months : sep is out of course so second date has 8 months full, then 8 months - 2(feb month) give 6 months.

Third : 1999 - 1951 give 48

So 48 years 6 months 10 days.


The other possible calculation is the "chronological substraction" like this :


-1
1998 8 5
1950 1 23

=48 =6 -18
+31 (number of days in month number 8 aug)
= 13

We have to count only years AND month full, eg as 1999 is not finish we write 1998, as month 9 is not finish we write 8 and so on. Only the days are of course finished.


Personaly I prefer 48 years 6 months AND 10 days, because "5+5=13" hurt me.

It is difficult to explain clearly in english, and I beg your pardon.

Gérard.

Gérard.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Year(s) Month(s) Day(s) between 2 dates - ggauny@live.fr - 10-23-2015 04:38 PM



User(s) browsing this thread: 1 Guest(s)