http://qs321.pair.com?node_id=10007


in reply to RE: RE: Re: Calculating a persons age based on their birthday.
in thread Calculating a persons age based on their birthday.

The above code is what I'd recommend using, as it's simple enough that the use of modules isn't really needed.. Then again I'm not a module-nazi:) One caveat about this code though: The value returned to $month in the call to localtime is 0 based, i.e. 0..11. I'm not sure if this might contrast the format of the $birth_month that is being passed in.. if so, just change the appropriate line to read
$age-- unless sprintf("%02d%02d", $month+1, $day)

Replies are listed 'Best First'.
RE: RE: RE: RE: Re: Calculating a persons age based on their birthday.
by turnstep (Parson) on May 03, 2000 at 04:37 UTC
    And just what is a module nazi?
      Someone who puts a tractor tire on a moped for fear of reinventing the wheel.