title: How to compare two datetime in javascript?
body: <p>I tried create markers by JSON parse from C #.I have a small problem about datetime compare in javascript.</p>
  
  <pre><code>  var nowDate= new Date();
  
    var LastTenMin= new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate(),nowDate.getHours(),nowDate.getMinutes()- 10);
  
   var Time1= data2.LastRecordTime;
  
   var image2;
  
    var status;
  
  
    if (new Date(Time1) &lt; new Date(LastTenMin)) {
  
  
    image2 = '/Images/truckOnline.png';
  
  
     status = "Truck is online."+"\n"+"Last seen:"+" "+Time1,
  
     }
  
   else {
  
  
     image2 = '/Images/truckOffline.png';
     status = "Truck is offline"+"\n"+"Last seen:"+" "+Time1,
  
  
              }
  </code></pre>
  
  <p>else is not working !   There are truckOnline markers on google map.Where is my mistake ?</p>
  
  <p>And LastRecordTime format like this in SQL :  04.12.2013 01:03:00</p>
  
  <pre><code>    LastRecordTime=CONVERT(VARCHAR(10), [ReadTimeColumn], 104) + ' ' + CONVERT(VARCHAR(8), [ReadTimeColumn],108)
  </code></pre>