Skip to content Skip to sidebar Skip to footer

Highcharts Datetime Axis, How To Comput Correct Timestamp?

Let say I want to draw a series where the first point represents the time 11:30 of november 5 2013. I want the time 11:30 to be the same if I look my chart with a browser in a diff

Solution 1:

The problem was in the python code... The correct way to construct a UTC timestamp for 11:30 november 5, 2013 is

>>>import datetime, calendar>>>t=datetime.datetime(2013,11,5,11,30,00)>>>calendar.timegm(t.utctimetuple())*1000.0 + t.microsecond * 0.0011383651000000.0
1383651000000.0

which is the correct timestamp to send to highcharts if useUTC=true

Post a Comment for "Highcharts Datetime Axis, How To Comput Correct Timestamp?"