PHP Another time "a"round
| From: | Jay Fitzgerald | Date: | Fri, 04 Apr 2003 18:32:31 +0000 |
| Subject: | PHP Another time "a"round | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-142392@lists.php.net to get a copy of this message | ||
I'm getting close to what I want...I currently have this code which loops through all of the next 24 hours:
<SELECT NAME="futhour">
<?
for($i = 0; $i <= 24; $i++):
$futhour = strtotime("+$i hour");
echo '<OPTION VALUE="'. date('H',$futhour) .'">'. date('g a',$futhour).'</OPTION>';
endfor;
?>
</SELECT>
is there a way to include the minutes of the hour in the above code, BUT have the minutes rounded to the nearest 1/2 hour?
e.g.:
12:00
12:30
1:00
1:30
Jay Fitzgerald, Design Director - CPW-A, CPWDS-A, CPWDV-A, CECM-A, CWCSB-A
Bayou Internet - http://www.bayou.com
Toll Free: 888.30.BAYOU (22968)
Vox: 318.338.2034 / Fax: 318.338.2506
E-Mail: jayfitz@bayou.com
ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf