title: Convert current time to nearest half hour
body: <p>I have a list of times displayed as radio buttons. I would like to use JavaScript to select the one closest to the users current time.  I'm already using jquery on my site (if that matters). Also I have another set of radio buttons that I'd like to default to select to +3 hours from the "Earliest Acceptable Time".</p>
  
  <pre><code>&lt;label for="select-choice-etime"&gt;Earliest acceptable time:&lt;/label&gt;
  &lt;select name="select-choice-etime" id="select-choice-etime"&gt;
      &lt;option value="12:00 AM"&gt;12:00 AM&lt;/option&gt;
      &lt;option value="12:30 AM"&gt;12:30 AM&lt;/option&gt;
      &lt;option value="1:00 AM"&gt;1:00 AM&lt;/option&gt;
      &lt;option value="1:30 AM"&gt;1:30 AM&lt;/option&gt;
      &lt;option value="2:00 AM"&gt;2:00 AM&lt;/option&gt;
      &lt;option value="2:30 AM"&gt;2:30 AM&lt;/option&gt;
      &lt;option value="3:00 AM"&gt;3:00 AM&lt;/option&gt;
      &lt;option value="3:30 AM"&gt;3:30 AM&lt;/option&gt;
      &lt;option value="4:00 AM"&gt;4:00 AM&lt;/option&gt;
      &lt;option value="4:30 AM"&gt;4:30 AM&lt;/option&gt;
      &lt;option value="5:00 AM"&gt;5:00 AM&lt;/option&gt;
      &lt;option value="5:30 AM"&gt;5:30 AM&lt;/option&gt;
      &lt;option value="6:00 AM"&gt;6:00 AM&lt;/option&gt;
      &lt;option value="6:30 AM"&gt;6:30 AM&lt;/option&gt;
      &lt;option value="7:00 AM"&gt;7:00 AM&lt;/option&gt;
      &lt;option value="7:30 AM"&gt;7:30 AM&lt;/option&gt;
      &lt;option value="8:00 AM"&gt;8:00 AM&lt;/option&gt;
      &lt;option value="8:30 AM"&gt;8:30 AM&lt;/option&gt;
      &lt;option value="9:00 AM"&gt;9:00 AM&lt;/option&gt;
      &lt;option value="9:30 AM"&gt;9:30 AM&lt;/option&gt;
      &lt;option value="10:00 AM"&gt;10:00 AM&lt;/option&gt;
      &lt;option value="10:30 AM"&gt;10:30 AM&lt;/option&gt;
      &lt;option value="11:00 AM"&gt;11:00 AM&lt;/option&gt;
      &lt;option value="11:30 AM"&gt;11:30 AM&lt;/option&gt;
      &lt;option value="12:00 PM"&gt;12:00 PM&lt;/option&gt;
      &lt;option value="12:30 PM"&gt;12:30 PM&lt;/option&gt;
      &lt;option value="1:00 PM"&gt;1:00 PM&lt;/option&gt;
      &lt;option value="1:30 PM"&gt;1:30 PM&lt;/option&gt;
      &lt;option value="2:00 PM"&gt;2:00 PM&lt;/option&gt;
      &lt;option value="2:30 PM"&gt;2:30 PM&lt;/option&gt;
      &lt;option value="3:00 PM"&gt;3:00 PM&lt;/option&gt;
      &lt;option value="3:30 PM"&gt;3:30 PM&lt;/option&gt;
      &lt;option value="4:00 PM"&gt;4:00 PM&lt;/option&gt;
      &lt;option value="4:30 PM"&gt;4:30 PM&lt;/option&gt;
      &lt;option value="5:00 PM"&gt;5:00 PM&lt;/option&gt;
      &lt;option value="5:30 PM"&gt;5:30 PM&lt;/option&gt;
      &lt;option value="6:00 PM"&gt;6:00 PM&lt;/option&gt;
      &lt;option value="6:30 PM"&gt;6:30 PM&lt;/option&gt;
      &lt;option selected="selected" value="7:00 PM"&gt;7:00 PM&lt;/option&gt;
      &lt;option value="7:30 PM"&gt;7:30 PM&lt;/option&gt;
      &lt;option value="8:00 PM"&gt;8:00 PM&lt;/option&gt;
      &lt;option value="8:30 PM"&gt;8:30 PM&lt;/option&gt;
      &lt;option value="9:00 PM"&gt;9:00 PM&lt;/option&gt;
      &lt;option value="9:30 PM"&gt;9:30 PM&lt;/option&gt;
      &lt;option value="10:00 PM"&gt;10:00 PM&lt;/option&gt;
      &lt;option value="10:30 PM"&gt;10:30 PM&lt;/option&gt;
      &lt;option value="11:00 PM"&gt;11:00 PM&lt;/option&gt;
      &lt;option value="11:30 PM"&gt;11:30 PM&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>