Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts convert x-axis time to localtime

I have a graph that needs to show server up-time against the user's local time. UTC is not acceptable, as it needs to show the user's computer time.

Is there a way to convert the x-axis time to localtime? My current input looks something like this:

[UNIX_TIMESTAMP,1], [UNIX_TIMESTAMP, 2], ...

If not possible in highcharts, how would I convert the above in UTC to in the user's localtime (i.e., offset the UNIX_TIMESTAMP)?

like image 408
David542 Avatar asked Apr 14 '13 22:04

David542


1 Answers

You can set useUTC to false in your global options:

http://api.highcharts.com/highcharts#global.useUTC

like image 188
jlbriggs Avatar answered Oct 21 '22 07:10

jlbriggs