View Full Version : Ultimate age calculator
denis and marrs
11-21-2002, 04:36 AM
Well I can't seem to get it to do the right thing.
I am just trying to display an age. Like say mine, my birthday is Feb 05, 1983 so you put down
1983, 2, 5, "", "0", "rounddown"
and what does it come up with, it says I am 20. No good. It should say I am 19, not 20. My point is how do you fix the mistake in the script to make it say the right age? I've been working on it for hours to see what I could ponder up, but I couldn't.
Thanks
glenngv
11-21-2002, 05:26 AM
where's the code?
denis and marrs
11-21-2002, 05:27 AM
oh sorry I forgot to put that. here it is
http://www.javascriptkit.com/script/script2/calculateage.shtml
BrightNail
11-21-2002, 06:55 AM
use a different age calculator..I don't think it takes things like leap year and the fact that different months sometimes have different # of days...
its seems that may 28th is the cut off...
denis and marrs
11-21-2002, 06:56 AM
any idea where can find one...?
BrightNail
11-21-2002, 07:02 AM
try these..
http://html_help4u.tripod.com/agecalc.html
http://www.css.tayloru.edu/~nschutt/comp/javascript/agecalc.shtml
http://www.geocities.com/devpragad/agecalc.htm
http://simplythebest.net/info/javascript67.html
denis and marrs
11-21-2002, 07:31 AM
Hey thanks for your help and giving me those links. But it's not the thing I want to display on the site. I just the numbers like to say just "19" and turn 20 when it's the birthday and so on and son on. Thanks again though.
beetle
11-21-2002, 03:26 PM
Ok, this should be 99% accurate, plus a little extra fluff from the date object I wrote :D
http://www.lanwizards.com/test.htm
Anyone who wishes to refine the algorithm (it's not perfect) is welcome to do so.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.