title: Ionic angular app convert milliseconds to Date Time from local storage
body: <p>I have an Ionic Mobile App where i receive data from localstorage.</p>
  <p>I want to display the milliseconds in to date format. I am following the below code but not able to get the result. Please suggest where i am doing the mistake</p>
  <p>Localstorage has data as below:</p>
  <pre><code>{&quot;data&quot;:[[0,&quot;1599843000000&quot;],[1,&quot;1599929580000&quot;],[2,&quot;1600448100000&quot;],[3,&quot;1599843360000&quot;],[4,&quot;1599843420000&quot;],[5,&quot;1599843420000&quot;]]}
  
  1599843000000 is milliseconds
  </code></pre>
  <p>Now i want to display all the records in date time format like below.</p>
  <pre><code>Fri 11 September 2020 22:20:00
  </code></pre>
  <p>my home.html looks like below:</p>
  <pre><code>&lt;ng-container *ngFor=&quot;let item of items[0]&quot; &gt;
        &lt;ion-item no-lines *ngIf='this.items!= 0'&gt;
          &lt;ion-row&gt;
            &lt;ion-col&gt;
              &lt;h3 ion-text&gt;
                {{item [0]}}
              &lt;/h3&gt;
            &lt;/ion-col&gt;
            &lt;ion-col&gt;
              &lt;h3 ion-text&gt;
                {{item [1]}}
              &lt;/h3&gt;
            &lt;/ion-col&gt;
          &lt;/ion-row&gt;
        &lt;/ion-item&gt;
      &lt;/ng-container&gt;
  </code></pre>
  <p>my home.ts for saving the data in localstorage looks like below:</p>
  <pre><code>if(!localStorage.getItem(&quot;dataset&quot;))
        {
          var dataset = {data: []};
          localStorage.setItem(&quot;dataset&quot;, JSON.stringify(dataset));
        }
  </code></pre>
  <p>my home.ts for retrieve the data from localstorage looks like below:</p>
  <pre><code>var datasetData = localStorage.getItem(&quot;dataset&quot;);
  
  let datasetArray = JSON.parse(datasetData );
  
  this.datasetlength= dataset.data.length;
  
      var dataArray = new Array();
  
      for (var i=0;i&lt;this.datasetlength;++i){
          dataArray [i] = datasetArray .data[i];
        }
  
      var dataArraysortedarray = dataArray ;
  
      this.items.push(dataArraysortedarray );
  </code></pre>