title: Javascript add hours to time
body: <p>I have this javascript code which should show the time. It works. I wan't to be able to add extra time though. Lets say that I want to add 1 hour.</p>
  
  <pre><code>        &lt;script type="text/javascript"&gt;
          Date.prototype.addHours = function(h) {    
             this.setTime(this.getTime() + (h*60*60*1000)); 
             return this;   
          }
          // This function gets the current time and injects it into the DOM
  
          function updateClock() {
              // Gets the current time
              var now = new Date();
  
              // Get the hours, minutes and seconds from the current time
              var hours = now.getHours();
              var minutes = now.getMinutes();
              var seconds = now.getSeconds();
  
              // Format hours, minutes and seconds
              if (hours &lt; 10) {
                  hours = "0" + hours;
              }
              if (minutes &lt; 10) {
                  minutes = "0" + minutes;
              }
              if (seconds &lt; 10) {
                  seconds = "0" + seconds;
              }
  
              // Gets the element we want to inject the clock into
              var elem = document.getElementById('clock');
  
              // Sets the elements inner HTML value to our clock data
              elem.innerHTML = hours + ':' + minutes + ':' + seconds;
          }
      function start(){
          setInterval('updateClock()', 200);
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>The first function calculates the milisecons that I want to add, and the second function is the "live clock". How do I implement the first function into the second one, so I get the working result?</p>