title: Compare Date & Time in JQuery
body: <p>I want to some message by date comparing in jquery. 
      <strong>for example:</strong>
      I have a <strong>text box</strong> value as <code>04/01/2013 13:15:32</code> filled by userend.
      And a current date time in jquery variable as <code>04/01/2013 18:30:12</code>
      if text box value is less then current datetime then show a message:</p>
  
  <pre><code>function foo(){
      usrDate = jQuery("#txtDate").val(); //getting user input date time
  
      currentDate = new Date(); //system current date
      currentMonth = currentDate.getMonth() + 01;
      currentDay = currentDate.getDate();
      currentYear = currentDate.getFullYear();
      currentHours = currentDate.getHours();
      currentMinutes = currentDate.getMinutes();
      currentSeconds = currentDate.getSeconds();
  
      currentcpDateTime = currentMonth + "/" + currentDay + "/" + currentYear + " " + currentHours + ":" + currentMinutes + ":" + currentSeconds;
         if (usrDate &gt; currentcpDateTime ) {
         alert("you can not choose date greater then current");   
      }
     else {
        alert("valid date");
   }
  }
  </code></pre>
  
  <p>each time wrong result. :( </p>