title: In JavaScript, How to convert string into Date ? Where string may have different culture format
body: <p>Hi I am getting DateString in JavaScript from the TextBox like,</p>
  
  <pre><code>    var dateString = document.getElementById('&lt;%= txtEffDate.ClientID %&gt;').value;
  </code></pre>
  
  <p>dateString value may be in following format.</p>
  
  <p>en-US -> "4/29/2010"</p>
  
  <p>fr-FR -> "29/04/2010"</p>
  
  <p>de-DE -> "29.04.2010"</p>
  
  <p>it-IT -> "29/04/2010"</p>
  
  <p>es-ES -> "29/04/2010"</p>
  
  <p>zh-CN -> "2010/4/29"</p>
  
  <p>ja-JP -> "2010/04/29"</p>
  
  <p>sv-SE -> "2010-04-29"</p>
  
  <p>And converting this to Date Object as follows,</p>
  
  <p>var d1 = new Date(dateString);</p>
  
  <p>though its giving me the wrong result like for fr-FR  "29/04/2010" ==> "Fri May 4 00:00:00 UTC+0530 2012"</p>
  
  <p>Which is completely irrelevant, How should I get the correct Date ?</p>
  
  <p>I have also set &lt; globalization culture="auto" /> in web.config &amp; &lt; asp:ScriptManager ID="scr1" runat="server" EnableScriptGlobalization="true"/></p>