Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highstock/Highcharts timestamp values

What is the values in a highcharts / highstock time mean ?

For example one of the values are [1147651200000,67.79], when I used http://www.onlineconversion.com/unix_time.htm to convert 1147651200000, its Sun, 15 Aug 38337 00:00:00 GMT

The year seems a bit off

I've the following code from the sample at highstock

$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function(info) {
            data = info;

            $('#container').highcharts('StockChart', {
            rangeSelector : {
                selected : 1
            },

            title : {
                text : 'Title'
            },

            series : [{
                name : 'Name',
                data : data,
                marker : {
                    enabled : true,
                    radius : 3
                },
                shadow : true,
                tooltip : {
                    valueDecimals : 2
                }
            }]
            });
         });

It's reading source from http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?

What does the first variable in the array mean? It doesn't seem to be timestamp.

like image 264
Steve Ng Avatar asked Mar 22 '23 23:03

Steve Ng


1 Answers

The time parameters are expressed in milliseconds. Unix times are seconds, so try dividing by 1000 and try the conversion again.

like image 134
SteveP Avatar answered Apr 05 '23 19:04

SteveP