title: Converting string to date object, adding two hours and converting back to string (JavaScript)
body: <p>I have a date string, want to convert it into a date object, add 2 hours and print out the converted date object back to a variable. But I get the error listed bellow:</p>
  
  <pre><code>// dateTime: 2013-09-27 09:50:05 
  var dateTime = $("#inputDatetime").val();
  var startDate = dateTime;
  var date = new Date(startDate);
  var duration = 2;
  var endDate = date;
  endDate.setHours(date.getHours()+duration)
  var dateString = endDate.format("dd-m-yy hh:mm:ss");
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Uncaught TypeError: Object [object Date] has no method 'format'
  </code></pre>
  
  <p>Why do I get this TypeError?</p>