title: How to save Date & Time in Parse.com using Javascript
body: <p>I am trying to get the Date and Time from the user and want to submit it to Parse.com. But when I am facing the problem with the following code</p>
  
  <p>What mistake am I doing here? </p>
  
  <pre><code>&lt;div id="main"&gt;
   &lt;form name="myForm" action="" method="get"&gt;
   Date: &lt;input type="datetime-local" name="datentime" id="theDate"&gt;
  &lt;input type="submit" value="Submit" onclick="myFunction()"&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>and the javascript code</p>
  
  <pre><code>function myFunction()
  {
      var TestObject = Parse.Object.extend("TestObject");
      var testObject = new TestObject();  
      var date = new Date();
      date = document.getElementById("theDate").value; //document.forms["myForm"]   ["datentime"].value; /*new Date();*/
  
      testObject.set("myDate", date);
      testObject.save(null, {
      success: function(testObject) {
          $(".success").show();
      },
      error: function(testObject, error) {
          $(".error").show();
      }
      });
  }
  </code></pre>
  
  <p>In above line testObject.set("myDate", date); this like is not working.I am not sure how to take the input from the date and give it to the parse.com
  where the column name is myDate of type Date
  If I try testObject.set("foo","testing...") where foo is column name of type string.It's working properly </p>