note 2445 deleted from function.getdate by jimw
| From: | jimw@php.net | Date: | Mon, 22 Oct 2001 23:39:04 +0000 |
| Subject: | note 2445 deleted from function.getdate by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-19294@lists.php.net to get a copy of this message | ||
This makes a live clock.
$date = getdate();
$minutes = $date['minutes'];
$hours = $date['hours'];
$tz="EST"; /* Set your time zone here */
/* initialize $ampm */
$ampm="AM";
if ($hours > 12) {
$hours=$hours-12;
$ampm="PM";
}
/* Fix minutes so that minutes 1-9 have 2 digits */
if ( $minutes < 10) {
$minutes="0$minutes";
}
/* Output: H:M AM/PM TIME ZONE */
print "$hours:$minutes $ampm $tz";