Steve Ng
Steve Ng

Reputation: 1189

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.

Upvotes: 4

Views: 4366

Answers (1)

SteveP
SteveP

Reputation: 19093

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

Upvotes: 7

Related Questions