info about link
: Javascript : PHP : MySQL Index :
date of birth 2 age
: Source : : Explanation : : Example : : Todo : : Feedback :

Suppose we have a table People - containing information about .. people, that has a field DoB, which is of the type DATE and that contains the Date of Birth
It is fairly simple to calculate the current age as shown in the example.

Of course NOW() can be substituted for any DATE(TIME) field, or a string of the format YYYY-mm-dd
=[Disclaimer]=     © 2005-2012 Excudo.net