title: Wrong Date format determined by Angular
body: <p>I have been working with Angular 5 to show a timeline. The start and end dates are stored in DB sent from the back-end via REST.</p>
  
  <p>I am getting the dates in the following format.</p>
  
  <p>Start:  02-12-2019 11:26</p>
  
  <p>End:  13-12-2019 13:14</p>
  
  <p>As I need to convert this date to a given format, <em>'dd-MM-yy'</em> I tried using datepipe and I was getting Invalid pipe argument error for the second date. -> <code>"InvalidPipeArgument: '13-12-2019 13:14' for pipe 'DatePipe'"</code></p>
  
  <p>Then I tried to print the dates using</p>
  
  <pre><code>Date startDate = new Date(startDateIn);
  Date endDate = new Date (endDateIn);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Start Date:  Tue Feb 12 2019 11:26:00 GMT+0530 (India Standard Time)
  End Date:  Invalid Date
  </code></pre>
  
  <p>Is there any way to make Angular know that the input date is in 'dd-mm-yyyy HH:mm' format?</p>