title: How to convert epoch to readable dates in Angular to use in Chartist
body: <p>Here I'm getting an array of date/time epochs</p>
  
  <pre><code>ApiFactory.getTweetQuotes(the_ticker).then(function(data) {
      // Create epoch array:
      for (var i = 0; i &lt; data.data.quotes.length; i++) {                    
          vs.tweet_epochs.push(data.data.quotes[i].start_epoch);
      }
  
      console.log(vs.tweet_epochs);
  
      initChart();
      vs.loadingChart = true;
  });
  </code></pre>
  
  <p><code>vs.tweet_epochs</code> looks like this consoled out:
  <img src="https://i.stack.imgur.com/d6vCd.png" alt="enter image description here"></p>
  
  <p>I'm using <strong><a href="http://gionkunz.github.io/chartist-js/index.html" rel="nofollow noreferrer">Chartist</a></strong> and it's not printing out very pretty at the moment:
  <img src="https://i.stack.imgur.com/GHuG9.png" alt="enter image description here"></p>
  
  <p>I found this answer here <a href="https://stackoverflow.com/questions/4631928/convert-utc-epoch-to-local-date-with-javascript">Convert UTC Epoch to local date with javascript</a> however it just added 3 more <code>0</code>'s to each epoch instead of convert them into dates.</p>
  
  <p>If you need the Charist code:</p>
  
  <pre><code>var initChart = function() {
      var data = {
  
          labels: vs.tweet_epochs,
          series: [
              vs.tweet_vol
          ]
      };
  
      // Chart options:
      var options = {
          showPoint: true,
          showArea: true,
          lineSmooth: true,
          fullWidth: true,
          axisX: {
              showGrid: false,
              showLabel: true
          },
          axisY: {
              offset: 40,
              labelInterpolationFnc: function(value) {
                  return '$' + value;
              }
          }
      };
  
      var chart = new Chartist.Line('.ct-chart', data, options);
  
  }
  </code></pre>