note 36334 added to function.mktime
| From: | fred_sa at fredjones dot dyndns dot org | Date: | Mon, 06 Oct 2003 08:21:55 +0000 |
| Subject: | note 36334 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-57883@lists.php.net to get a copy of this message | ||
The easiest way by far to get a person's age.
//$bdate is the timestamp of the birthdate
$born = date ("Ymd", $bdate);
$age = floor((date(Ymd) - $born)/10000);
Two lines to find a person's age. Not bad at all.
(If getting $bdate from mysql just use UNIX_TIMESTAMP(bdate)
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36334
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36334&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36334&report=yes
Search -- http://master.php.net/manage/user-notes.php