title: How to set current time to some other time in javascript
body: <p>I am trying to set current time to some other time and whenever i try to access current time i need to get the new time. Suppose current time is 2 am in my local machine. But I want to change it to 10 am and current time should keep ticking from 10 am instead of 2 am whenever i access it.</p>
  
  <p>Ex:</p>
  
  <pre><code>var x = new Date();
  </code></pre>
  
  <p>if you see x.getHours() fetches my local time which is 2 am
  and every time it keeps ticking with 2 am as its base.</p>
  
  <p>But I need to change it to 10 am so that my new Date() gives 10 am and keeps ticking every second based on that.</p>
  
  <p>I do not want to use setInterval() for this purpose. I sure have solution with setInterval(). But the thing is I have multiple setIntervals and the other one is stopping from updating the time in the setInterval() where I am trying to update 10 am every second.</p>