Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

RE: RE: RE: Re: Calculating a persons age based on their birthday.

by plaid (Chaplain)
on May 03, 2000 at 04:06 UTC ( #10007=note: print w/replies, xml ) Need Help??


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)
  • Comment on RE: RE: RE: Re: Calculating a persons age based on their birthday.
  • Download Code

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://10007]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2022-05-29 12:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?