title: Digits with leading zero in date and time
body: <p>I found this Javascript script online which refreshes the time every second and displays it. I want the program to display digits with leading zero. Currently it's showing 6/8/2017 - 19:8:54 but I want it to show 06/08/2017 - 19:08:54.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt; 
      function display_c(){
          var refresh=1000; // Refresh rate in milli seconds
          mytime =setTimeout('display_ct()',refresh)
      }
  
      function display_ct() {
          var strcount
          var x = new Date()
          var x1=x.getDate() + &quot;/&quot; + x.getMonth() + &quot;/&quot; + x.getYear(); 
          x1 = x1 + &quot; - &quot; + x.getHours( )+ &quot;:&quot; + x.getMinutes() + &quot;:&quot; + 
          x.getSeconds();
          document.getElementById('ct').innerHTML = x1;
  
          tt=display_c();
      }
  &lt;/script&gt;
  </code></pre>