title: How to get time in select box with half hour interval in jquery
body: <p>I am not getting 23:30 in option of select box. Can anybody tell me the correct way to add with 30 minute interval in option.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>jQuery(document).ready(function() {
    var hr = "00";
    var mi = "00";
    var count = 0;
    for (hr = "0"; hr &lt; 24; hr++) {
      if (hr &lt; 10) {
        apd = "0";
      } else {
        apd = ""
      }
      if (count % 2 == 0) {
        mi = "00";
  
        jQuery("#bmg_monday_start_hour").append('&lt;option val="' + apd + hr + ':' + mi + '"&gt;' + apd + hr + ':' + mi + '&lt;/option&gt;');
      } else {
        hr--;
        mi = "30";
  
        jQuery("#bmg_monday_start_hour").append('&lt;option val="' + apd + hr + ':' + mi + '"&gt;' + apd + hr + ':' + mi + '&lt;/option&gt;')
      }
      count++;
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;div&gt;
    &lt;select name="bmg_monday_start_hour" id="bmg_monday_start_hour" class="form-control bmg-hrs-mins-input"&gt;&lt;/select&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>