title: Convert string to date in Angular 8
body: <p>In my angular component let's say that i have this string '16/12/2020 12:30:00' (french format).</p>
  <p>How can I convert this to an Date object in the component ?</p>
  <pre><code>expiration_date: Date;
  ngOnInit() {
  
     this.dateService.getOne('EXP_DATE').subscribe((data) =&gt; {
        this.expiration_date = new Date(data.value);
     });
  
      console.log(this.expiration_date);
  }
  </code></pre>
  <p>I've tried formatDate as well as DatePipe but i get the following message:</p>
  <blockquote>
  <p>&quot;Unable to convert '16/12/2020 12:30:00' into a date&quot;.</p>
  <p>undefined</p>
  </blockquote>