note 12967 deleted from function.mktime by hholzgra
| From: | hholzgra@php.net | Date: | Sun, 14 Apr 2002 22:12:12 +0000 |
| Subject: | note 12967 deleted from function.mktime by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-29329@lists.php.net to get a copy of this message | ||
On the Windows platform, mktime fails on dates before the UNIX epoch.
For date calculations, I use the database date functions (MySQL in this case)...
How old is a person in years?
SELECT birth_date, FLOOR((TO_DAYS(CURRENT_DATE()) - TO_DAYS(birth_date))/365.25) AS age FROM person
TO_DAYS() calculates the number of days since year 0, see we are OK if the date we want is before
1902. See DB documentation for details.