note 17432 deleted from function.mktime by jimw
| From: | jimw@php.net | Date: | Thu, 20 Dec 2001 22:24:54 +0000 |
| Subject: | note 17432 deleted from function.mktime by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-23489@lists.php.net to get a copy of this message | ||
REGARDING ABOVE NOTE ON CALCULATING AGE...
Because of strange possibilities mentioned (due to varying
platforms, servers, versions etc.), I would improve the above age
calculating code in 2 ways:
1. Go ahead and plug in a safe year (any 4-digit year above 1970)
for the 2 usages of mktime instead of zero -- make sure the years
are the same though!
2. Go ahead and make sure that when you setup the $bday_mm_dd and
$today_mm_dd variables that you use the same format regarding
leading zeros. In other words, if $bday uses leading zeros, use
date("m") and date("d") when assigning $today_mm_dd.
Otherwise, use date("n") and date("j").
That's all. (Just to be safe.)
-DON