![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.php archiveRe: How do you get someone's age from DOB?
From: Justin Koivisto <justin@koivi.com>
Date: Mon Jan 30 2006 - 21:19:03 CET
comp.lang.php wrote:
unix timestamp of birth date (midnight if no time is included) - if on
>> $age = date("Y") - date("Y",$birthdate);
The current 4-digit year minus the 4 digit birth year (assuming that the
>> if ((date("n") < date("n",$birthdate)) or ((date("n") ==
if (
>> $age--;
Take off a year because they haven't hit their birthday of this year yet
>> }
The number of years old they are
-- Justin Koivisto, ZCE - justin@koivi.com http://koivi.comReceived on Tue Feb 7 21:07:55 2006 |