title: Converting ISO-8601 string to local date in typescript/javascript
body: <p>I am developing in Angular 6. I keep form values as json in a database when new record is saved.If end user wants to show exists record , I fill form components from json data.But I got into trouble for casting date values . I wasn't be able to cast correctly my local date.
  I have tried with moment,but didn't work:</p>
  <pre><code>console.log(&quot;string Value&quot;,stringValue);
  let date = moment(stringValue,&quot;yyyy-mm-ddThh:mm:ss.fffZ&quot;);                             
  console.log(&quot;date&quot;,date.format('DD/MM/YYY HH:mm:ss'));
  </code></pre>
  <blockquote>
  <p>string Value  output: 2019-01-17T21:00:00.000Z</p>
  <p>console output actual : date 18/01/2019 01:00:00</p>
  <p>but console output expected : date 18/01/2019 00:00:00</p>
  </blockquote>
  <p>I tried <em>&quot;YYYY-MM-DDThh:mm:ss.fffZ&quot;</em> but didn't work too.</p>
  <p>EXTRA INFORMATION</p>
  <p>saving data:</p>
  <pre><code>process.data = JSON.stringify(this.form.getRawValue());
  save(process);
  </code></pre>
  <p>html(primeng):</p>
  <pre><code>&lt;p-calendar formControlName=&quot;startDate&quot; dateFormat=&quot;dd.mm.yy&quot;&gt;&lt;/p-calendar&gt;
  </code></pre>