title: Convert querstring parameter to javascript date object fails - NaN
body: <p>I am trying to convert a querystring value into Javascript date object and then converting it into ISO Date format.</p>
  
  <p>I have three button - one extracts the querystring and displays the value - works properly
  Second, uses first function to extract querystring (works) and then converts to Date - fails - get NaN
  Third, passes a hardcoded string directly to the second function - works.</p>
  
  <p>Code is shown below. How do I get a querstring value to be converted to Javascript Date</p>
  
  <pre><code>&lt;head&gt;
  &lt;SCRIPT LANGUAGE="JavaScript" SRC="./date.format.js"&gt;
  &lt;/SCRIPT&gt;
  &lt;/head&gt;
  &lt;script&gt;
  function DateTest(dt)
  {
  var myDate = new Date(dt);
  alert(myDate);
  var newDate = myDate.format("isoDateTime");
  document.write(newDate);
  alert(newDate);
  }
  
  function QueryDateTest(parm)
  {
   DateTest(getRequestParameter(parm));
  }
  function getRequestParameter( name ) {
  var strReturn = "";
    var strHref = window.location.href;
    if ( strHref.indexOf("?") &gt; -1 ){
      var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
      var aQueryString = strQueryString.split("&amp;");
      for ( var iParam = 0; iParam &lt; aQueryString.length; iParam++ ){
        if (aQueryString[iParam].indexOf(name.toLowerCase() + "=") &gt; -1 ){
          var aParam = aQueryString[iParam].split("=");
          strReturn = aParam[1];
          break;
        }
      }
    }
    alert(unescape(strReturn));
    return(unescape(strReturn.toString()));
  }
  &lt;/script&gt;
  &lt;body&gt;
  &lt;input type="button" id="hello-world1" value="QueryString" onClick="getRequestParameter('create');" /&gt;
  &lt;input type="button" id="hello-world2" value="ISODate" onClick="QueryDateTest('create');" /&gt;
  &lt;input type="button" id="hello-world3" value="HardCoded" onClick="DateTest('11/10/2009');" /&gt;
  </code></pre>