note 63836 deleted from function.mktime by nlopess
| From: | nlopess@php.net | Date: | Sun, 02 Apr 2006 16:35:50 +0000 |
| Subject: | note 63836 deleted from function.mktime by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107172@lists.php.net to get a copy of this message | ||
Note Submitter: (zhao xinyou)totoyou_at_Gmail__com
----
how to accurately calculate your age ?
<?
$year=1976;
$month=10;
$day=12;
$birthday=mktime(0,0,0,$month,$day,$year);
$now=time();
$daytime=$now-$birthday;
$age=$daytime/365/24/60/60;
echo $age;
?>
maybe there are many bissextile year during your life. so you should divide 366 sometimes. so the
algorithm is not good. who give one good algorightm for this situation?
thanks a lot.