On 11/14/2013 8:16 AM, Mattias Gaertner wrote:
On Thu, 14 Nov 2013 13:48:46 +0100
John Landmesser <[email protected]> wrote:

[...]
"Our" function delivers the age of a person in years, months, days.

What is your diff between 31th Jan and 30 March 2013?

the one i am currently testing returns

  2013-01-31 to 2013-03-30 is    0 yrs    1 mos   30 days


FWTW, too ;)

leapyear:
  2012-01-31 to 2012-03-30 is    0 yrs    1 mos   30 days

non-leapyear to leapyear:
  2011-01-31 to 2012-03-30 is    1 yrs    1 mos   30 days

leapyear to non-leapyear:
  2012-01-31 to 2013-03-30 is    1 yrs    1 mos   30 days

non-leapyear thru leapyear to non-leapyear:
  2011-01-31 to 2013-03-30 is    2 yrs    1 mos   30 days

leapyear thru non-leapyear to non-leapyear:
  2012-01-31 to 2014-03-30 is    2 yrs    1 mos   30 days


the whole of Feb is counted as a month no matter how many days it has...

--
NOTE: No off-list assistance is given without prior approval.
      Please keep mailing list traffic on the list unless
      private contact is specifically requested and granted.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to