note 37823 deleted from function.mktime by derick
| From: | derick@php.net | Date: | Sun, 24 Sep 2006 12:07:39 +0000 |
| Subject: | note 37823 deleted from function.mktime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117531@lists.php.net to get a copy of this message | ||
Note Submitter: verszuz at hotmail dot com
----
I figured out this way to calculate your age using mktime:
<?php
$day=27;//the day of birth variable
$month=10;//the month of birth variable
$year=1977;// the year of birth variable
$now=mktime();
echo $now."<br>";
$timebirth=mktime(0,0,0,$month,$day,$year);
echo $timebirth."<br>";
$agetime=$now-$timebirth;
echo ((strftime("%Y",$agetime))-(strftime("%Y",0)));
?>
I hope this will help. Remember this calculator does not work properly on windows because of the
limited range of mktime().