This topic is locked

calculate age of user

3/27/2009 6:31:33 AM
PHPRunner General questions
F
futo author

hello,
i have in table USERS field DAYOFBIRTH [date],
what i want is to show in field called AGE [varchar] the age of user
thanks
phprunner 5.1 3177 trial

J
Jane 3/27/2009

Hi,
use Before record added/Before record updated events on the Events tab to calculate correct age.

Here is just a sample:

$values["age_field"] = (strtotime("now")-strtotime($values["FieldName"]))/(606024*365);