title: Angular material date picker: Date Parsing UTC problem 1 day before
body: <p>I know there are several threads about this and i read them all but couldn't fix this for days. I might found a solution but it seems to be do dirty for me.</p>
  
  <p>So as other users I have the same problem with the datePicker. For me it's the Angular Material Datepicker <code>mat-datepicker</code></p>
  
  <p>When I log the value I get the correct result:</p>
  
  <pre><code>Wed Dec 24 1999 00:00:00 GMT+0100 (Mitteleuropäische Normalzeit)
  </code></pre>
  
  <p>but in the request it is</p>
  
  <pre><code>1999-12-23T23:00:00.000Z
  </code></pre>
  
  <p>What I tried yet:</p>
  
  <p>I've added <code>{ provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: true } }</code> to my <code>component</code> and to my <code>app.module.ts</code>. That does not make any difference for me.</p>
  
  <p>My dirty solution (before sending the request):</p>
  
  <pre class="lang-js prettyprint-override"><code> let newDate= new Date(this.personalForm.get("dateOfBirth").value);
   newDate.setMinutes(newDate.getMinutes() - newDate.getTimezoneOffset());
  </code></pre>
  
  <p>When I am doing this the console logs:</p>
  
  <pre><code>Wed Dec 24 1999 01:00:00 GMT+0100 (Mitteleuropäische Normalzeit)
  </code></pre>
  
  <p>and the request is right:</p>
  
  <pre><code>1997-12-24T00:00:00.000Z
  </code></pre>
  
  <p>But if somebody now would be from a different timezone like GMT-0100 this would again not work. How to fix this correctly?</p>
  
  <p>I also change the adapter dynamically if it's necessary to know:</p>
  
  <pre class="lang-js prettyprint-override"><code> this._adapter.setLocale(this.translateService.currentLang);
  </code></pre>