note 48812 added to function.date
| From: | info at oscaralexander dot com | Date: | Fri, 07 Jan 2005 17:37:56 +0000 |
| Subject: | note 48812 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82914@lists.php.net to get a copy of this message | ||
Here's a briljant theory to calculate one's age :) Don't worry, I didn't come up
with this myself.
Subtract a persons date of birth (formatted without any separators) from the current date, divide
that number by 10.000 and round it down. i.e.:
$age = floor((20050107 - 19810304) / 10000);
How cool is that?! :)
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48812
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48812&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48812&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48812&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48812&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48812&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48812&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48812&report=yes
Search -- http://master.php.net/manage/user-notes.php