title: Format date in Angular 2
body: <p>I am using Angular2(typescript), I have a problem with type Date:</p>
  
  <p>I get a String e.g " <code>26/06/2018</code> " I need convert this String in other String <code>2018-06-26T00:00:00+01:00</code></p>
  
  <p>I tried with : </p>
  
  <pre><code> let dateStart : any ;
  
    if (filterDateStart != undefined) {
        console.log('before' , filterDateStart);
        dateStart = new Date(filterDateStart).toLocaleTimeString();
        console.log('After' , dateStart); ---&gt;  ƒ toLocaleTimeString() { [native code] }
    }
  </code></pre>
  
  <p>or   <code>dateStart = new Date(filterDateStart).toLocaleDateString();</code> I don't get format <code>26T00:00:00+01:00</code></p>
  
  <p>How I can resolve this ? Thanks.</p>
  
  <p><strong>Update :</strong> </p>
  
  <p>I tried with : </p>
  
  <pre><code>  dateStart = new Date(filterDateStart.split('/').reverse().join('/'));
    dateStart = new Date(filterDateEnd).toLocaleDateString();
    dateStart =  new Date(filterDateStart).toISOString();
    dateStart = new Date(filterDateStart.split('/').reverse().toISOString('/'));
  </code></pre>