note 2445 modified in getdate by ronabop
| From: | ronabop@php.net | Date: | Fri, 20 Oct 2000 06:02:52 +0000 |
| Subject: | note 2445 modified in getdate by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6731@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";
http://www.php.net/manual/function.getdate.php