crabsodyinblue
Programmer
- Aug 22, 2001
- 14
Is there any standard formula to determine the time elapsed between 2 dates and express it in days , months , years.
I have 2 dates date of birth DD/MM/YY and today's date DD/MM/YY
I have a cobol program which I call to calculate the person's age in years , months and days , however the problem is in the definition of a month.
For example
04th Mar YY to 04th Apr YY is classed as 1 month
but if the start date is 28th Feb , what date would anyone say that the following month ended , would it be
a) 28th of March or
b) 31st March
Has anyone had similar problems , is there any set formula or definition for a month or is it similar to the question How long is a piece of string ?
I have 2 dates date of birth DD/MM/YY and today's date DD/MM/YY
I have a cobol program which I call to calculate the person's age in years , months and days , however the problem is in the definition of a month.
For example
04th Mar YY to 04th Apr YY is classed as 1 month
but if the start date is 28th Feb , what date would anyone say that the following month ended , would it be
a) 28th of March or
b) 31st March
Has anyone had similar problems , is there any set formula or definition for a month or is it similar to the question How long is a piece of string ?