Re: Age from birthdate?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



have you looked at to_days() and to_years() in the mysql manual

Dvdmandt wrote:

How would I get the age of someone if I store the birthdate in a date field?
I just realized FLOOR((UNIX_TIMESTAMP(NOW()) -
UNIX_TIMESTAMP(birthdate))/60/60/24/365.25)  wont work for persons born
before 1970... :p I must get the current age in years, and I must be able to
select by age... :p Any ideas?


-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux