Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: How to...? Convert Date of Birth to Age

From: ingo:2b1 at: 11-Nov-2002 1:06

Hi, I was searching for a function like this for a faq entry, but all your examples seem much too advnced for the intended audience, so I made up this silly little function: my-age: func [ a b /local t y m d ][ if a > b [t: a a: b b: t] y: b/year - a/year m: b/month - a/month d: b/day - a/day if d < 0 [ d: a/day + d m: m - 1 ] if m < 0 [ m: 12 + m y: y - 1 ] reduce [y m d] ] mind you, it's 1:00 am now and _looong_ past my bed-time. Kind regards, Ingo