title: Beginner: javascript date conversion from string to UTC date.js into SharePoint list
body: <p>I am trying to take a string'd date value from an element, and convert it to a js var in order to use SPServices to add to a SP 2010 list (date field).</p>
  
  <p>I found the date.js resource, but I am not sure how to properly use it. Everything I do that manipulates the date changes it to a string... .format() whatever.</p>
  
  <p>I think I need someway to change the value into : 2013-01-01T19:20:15 in order to pass through SPServices and update the list like below:</p>
  
  <pre><code>function CreateNewItem(subject, message) {
      $().SPServices({
          operation: "UpdateListItems",
          async: false,
          batchCmd: "New",
          listName: "Example",
          valuepairs: [["Title", subject], ["Message", message], ["DateField", date]],
          completefunc: function(xData, Status) {
            alert("completed");
          }
      });}
  </code></pre>
  
  <p>So I tried the Date.parse and it doesn't like the returned value, but I am not sure how to change the returned value without making it a string?</p>
  
  <p>Appreciate help as always.</p>
  
  <p>EDIT: more clarification....I am using XSLT to Grab values from XML file, and creating html page for viewing the values. So with xml </p>
  
  <pre><code>&lt;div id="thisDateExample"&gt;&lt;xsl:value of select="thisDateExampleDate"/&gt;&lt;/div&gt;
  </code></pre>
  
  <p>So then I have been trying a couple things, like getting the string value from jquery selector:</p>
  
  <pre><code>var thisDateThatIsDrivingMeCrazy = $('#thisDateExample').text();
  </code></pre>
  
  <p>So again, I am just learning all these things but I am thinking that made it a string, and I found the date.js to get it back to a date format I guess?</p>
  
  <pre><code>var thisDateConverted = new Date(Date.parse(thisDateThatIsDrivingMeCrazy));
  </code></pre>
  
  <p>Then trying to pass into SPServices? This is one approach that I guess thought made sense, but I must be doing something wrong here? If I alert this is uses a different format from what I need I  believe. but again per above, anything I do to format it (or what I can find on the subject to try out) seems to change it to a string (I am assuming) and doesn't work. help is always appreciated! Greatly!</p>