Posted By

bitsculptor on 09/09/11


Tagged

time selectbox


Versions (?)

Timestamp Selectbox 15 min intervals


 / Published in: PHP
 

Outputs a select box that has timestamps from 12AM-12PM in 15min increments.

  1. <?php
  2. for ($i = 0; $i <= 1440; $i+=15) :
  3. $date = date("g:i A",mktime(0,$i,0,1,1,2000));
  4. ?>
  5. <select>
  6. <option value="<?php echo $date; ?>"><?php echo $date; ?></option>
  7. </select>
  8. <?php
  9. endfor;
  10. ?>

Report this snippet  

You need to login to post a comment.