It is currently Sun Mar 09, 2014 1:21 pm Advanced search

## time axis incorrect

Technical support for the Highcharts Stock package

### time axis incorrect

In this example http://jsfiddle.net/tCSzs/1/ the 1m bars time-stamp rises monotonically, starts at 2012-02-17 00:00 and ends at 2012-02-17 22:45, however the Highstock chart indicates as if the first bar is at 2012-02-16 16:22 and ends at 2012-02-17 20:45
How come?

And in this example http://jsfiddle.net/Yhq4m/ the bars seem to be shifted by 2h backwards in time. For this second example, could it be linked to the fact that I'm located at +2 to GMT?
livni

Posts: 6
Joined: Sun Feb 19, 2012 5:12 pm

### Re: time axis incorrect

The first "issue" is caused by dataGrouping (http://www.highcharts.com/stock/ref/#pl ... taGrouping). Yes, it can be caused by 2h shift. By default Highcharts uses UTC time, if you want to use client timezone you have to set useUTC to false (http://www.highcharts.com/stock/ref/#global--useUTC)
Slawek Kolodziej
Highcharts support team
hfrntt

Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

### Re: time axis incorrect

Regarding the first case - I don't understand how dataGrouping can cause such a shift in start\end times. Could you elaborate? Notice that the start time shifted back by 7h and 38m and the end time shifted back by 2h. What can I do to correct this?

Regarding the second case - I haven't changed the default and the data itself is UTC, so how come there's a shift?
livni

Posts: 6
Joined: Sun Feb 19, 2012 5:12 pm

### Re: time axis incorrect

1. Check attached screenshot to see what I've got, there is something like "22:00-22:29" - time for the group of points. I've never got something like "16:22" here.

2. This is your first timestamp: 1329429600000, try type this into terminal (remove 3 zeros from the end, JS uses miliseconds):
Code: Select all
\$ date -ur 1329429600 // => Thu 16 Feb 22:00:00 2012 UTC
You'll notice what UTC time it is.
Attachments
Screen Shot 2012-03-05 at 15.56.58.png (24 KiB) Viewed 579 times
Slawek Kolodziej
Highcharts support team
hfrntt

Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

### Re: time axis incorrect

I have to admit that the errors were on my side. I was processing the timezones wrong in my backend python web framwork. Sorry for the confusion and thanks for taking the time to set me straight
livni

Posts: 6
Joined: Sun Feb 19, 2012 5:12 pm