title: Conversion 12-hour to 24-hour format with javascript
body: <p>I am trying to create a simple clock with javascript in 24-hour format. As far as i've come i only managed to get a 12-hour format. The script is really simple actually, here what i've got:</p>
  
  <pre><code>&lt;div id="updatetime"&gt;&lt;/div&gt;
  &lt;script&gt;
          setInterval(function(){
          var d = new Date();
          var curr_hour = d.getHours();
          var curr_minute = d.getMinutes() + 1;
          document.getElementById("updatetime").innerHTML = curr_hour + ":" + curr_minute;
      }, 1000);
  &lt;/script&gt;
  </code></pre>
  
  <p>as for my question: How do i convert the 12-hour output to a 24-hour output while still keeping it simple. Only the hours and minutes are needed.</p>