Two built-in functions: date( ) and mktime( ).
date(format, timestamp): output the given timestamp as date/time following the given format.
date(format): output the current date/time following the given format. That means without specifying timestamp, the default is current date/time.
mktime(hr, min, sec, month, day, year): output a series of number (also known as timestamp) that the system uses to represent the given date (day/month/year) and time (hr:min:sec).
To calculate your age, the following logic applies:
1. If your birthday for this year is already over, then your age will be this year minus your year of birth.
2. If your birthday for this year is NOT yet over, then your age will be this year minus your year of birth and then minus one.
http://phpfiddle.org/lite/code/1v3-zf0
Another exercise we did on date( ) and mktime( ):
http://phpfiddle.org/lite/code/49r-xsa