title: Format date in angular
body: <p>I have a date object coming from my java backend and I need to format it using angular or JS (I cannot use any plugin).</p>
  
  <p>My issue is that my java backend only accepts a string and parses it to date object later.</p>
  
  <p>In my current angular code, I am using:</p>
  
  <pre><code>JSON.parse(oldTime);
  </code></pre>
  
  <p>To convert the object to a string</p>
  
  <p>My current output:</p>
  
  <pre><code>2015-08-12T05:00:00.000Z
  </code></pre>
  
  <p>Output I need:</p>
  
  <pre><code>2015-08-12 02:00:00
  </code></pre>