title: How to convert this date in a string having this format using JavaScript?
body: <p>I am working on a JavaScript application and I am finding some difficulties trying to format a date.</p>
  
  <p>So I have a situation like this. I am creating an object like this:</p>
  
  <pre><code>returnedEvent = {
    title: eventEl.innerText,
    startTime: returnedEvent.startTime,
    duration: returnedEvent.duration
  }
  </code></pre>
  
  <p>As you can see in the previous snippet I have the field:</p>
  
  <pre><code>startTime: returnedEvent.startTime,
  </code></pre>
  
  <p>that contains a date object in this format:</p>
  
  <pre><code>Mon Feb 20 2017 07:00:00 GMT-0800 (Ora standard del Pacifico USA)
  </code></pre>
  
  <p>Ok but I need to convert this data in a string like this:</p>
  
  <pre><code>2017-02-20T07:00:00
  </code></pre>
  
  <p>What could be a smart way to achieve this task and convert the data in the desired string?</p>