my $age = (localtime ( time - $time ))[5]
Don't do this. A difference of two times is not something you should pass to localtime. If you only need an approximate age, you can use something like
$age = (time() - $time) / (60*60*24*365.25);If you want an accurate answer that takes leap years and stuff into account, use a package like Date::Manip or DateTime or whatever.
In reply to Re: getting answer 70 years off
by no_slogan
in thread getting answer 70 years off
by derekstucki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |