title: Check if date is less than 1 hour ago?
body: <p>Is there a way to check if a date is less than 1 hour ago like this?</p>
  <pre class="lang-js prettyprint-override"><code>// old date
  var olddate = new Date(&quot;February 9, 2012, 12:15&quot;);
  
  // current date
  var currentdate = new Date();
  
  if (olddate &gt;= currentdate - 1 hour) {
      alert(&quot;newer than 1 hour&quot;);
  else {
      alert(&quot;older than 1 hour&quot;);
  }
  </code></pre>
  <p>Also, different question - is there a way to add hours to a date like this?</p>
  <pre class="lang-js prettyprint-override"><code>var olddate = new Date(&quot;February 9, 2012, 12:15&quot;) + 15 HOURS; // output: February 10, 2012, 3:15
  </code></pre>