title: JavaScript moment format date string
body: <p>I am using the Moment JavaScript library to take a date from my jQuery UI date picker. The date picker is currently using a format of <code>mm/dd/YYYY</code> in order to display a value to a user, so today would show as: <code>12/17/2013</code>. I need to submit this date in an XHR request using the format <code>YYYYmmdd</code> so the example above would turn into <code>20131217</code>. I tried using Moment like this:</p>
  
  <pre><code>var t_date = moment($("#datepicker").attr('value').replace('/', '-'), "MM-DD-YYYY");
  </code></pre>
  
  <p>The result for <code>t_date</code> however, comes out to be a large double, almost like a unix timestamp. At that point, I'm not entirely sure how to have Moment convert it to the string result I need above so I can embed it into a RESTful URL for my XHR request.</p>