title: How can I compare if two dates in JS are equal?
body: <p>I have two dates in a form:</p>
  
  <pre><code>var date = Wed Oct 07 2015 19:48:08 GMT+0200 (Central European Daylight Time);
  
  var dateOne = new Date(date);
  var dateTwo = new Date();
  
  if (dateOne == dateTwo )
      alert ("equals");
  else{
      alert("not equal");
  }
  </code></pre>
  
  <p>and even if I set up the date on client's site to <code>Wed Oct 07 2015 19:48:08 GMT+0200 (Central European Daylight Time)</code> I'm still getting <code>not equal</code>...</p>
  
  <p>Even when I do this:</p>
  
  <pre><code>var data1 = new Date();
  var data2 = new Date();
  
  
  
  if (data1 == data2)
      alert ("equals");
  else{
      alert("not equal");
  }
  </code></pre>
  
  <p>The <code>not equal</code> appears again. What am I doing wrong?</p>