1.8 Technical note: dates

All dates are represented as a number of milliseconds, not as Javascript date objects.

The time zone of a chart is user-configurable. The dates you receive, in data.dates or data.barData.date, are the user's chart time, not UTC.

Similarly, any dates which you need to pass back to the chart, such as co-ordinates for creating a drawing or an event marker, also need to be numbers of milliseconds representing chart time rather than UTC.

If you need to convert the chart times to UTC (or another time zone), then you can use the helper functions described below.

Last updated