title: How to convert millisecond(1304921325178.3193) to 'yyyy-mm-dd' in javascript?
body: <p>How to convert <code>1304921325178.3193</code> to <code>yyyy-mm-dd</code> -&gt; in javascript?</p>
  <p>I use highchart and I would like to convert <code>data(xAxis[0]0)</code> to <code>yyyy-mm-dd</code>.</p>
  <p>I tried to parse the millisecond using this function</p>
  <pre><code>function(valTime) {
   var date = new Date(valTime);
   var y = date.getFullYear();
   var m = date.getMonth() + 1;    
   var d = date.getDate();    
   m = (m &lt; 10) ? '0' + m : m; 
   d = (d &lt; 10) ? '0' + d : d;
   return [y, m, d].join('-');
  }
  </code></pre>
  <p>However, there is a gap between actual date(2015-01-26) and selected date in the chart (2015-01-29).
  <a href="https://i.stack.imgur.com/HKLfm.png" rel="nofollow noreferrer">captured image</a>
  I guess if I calculate .3193, the date will be matched.</p>
  <p>Is there any way to get the right date from the millisecond?</p>