View Single Post
Old 02-12-2003, 10:16 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
PHP Code:
<?
// get the current time
$current_time=time();
echo 
$current_time;

// format time to current hour
// using "G" format for current hour 0-23
$current_hour=date("G",$current_time);
echo 
"<br>" $current_hour;

// set variable based on hour
if($current_hour == 14 || $current_hour == 15) {
  
$var 50;
  echo 
"<br>" $var;
}
?>
here's a good reference for the date() function
http://www.php.net/manual/en/function.date.php
sde is offline   Reply With Quote