title: javascript - convert date to long based on the language specific format
body: <p>I have two date pickers one for startDate and another one is for endDate.</p>
  
  <p>The date pickers is returning me values in following formats, based on the language of the application :</p>
  
  <pre><code>language selected by user    datepicker value(start and end)
  ========================     ===============================
            en                     03/30/2012 | 04/12/2012
            es                     30/03/2012 | 12/04/2012
  </code></pre>
  
  <p>My javascript code is something like :</p>
  
  <pre><code>var startDate = new Date ($('startDate'+counter).value);
  var endDate = new Date($('endDate'+counter).value);
  
  if(endDate.getTime() &gt; startDate.getTime()){
  //if part logic
  }
  else{
  // else part logic
  }
  </code></pre>
  
  <p>above code is working fine with en language, but failing with es, because of the different date format in the datepicker.</p>
  
  <p>That means <code>endDate.getTime()</code> and <code>startDate.getTime()</code> is returning wrong value in case of <code>es</code> language.</p>
  
  <p>I am using prototypejs...</p>