Q:

How do I convert to UTC?

For highstock / highcharts I need the date format to be like this:
series: [{
    data: [[1331028000000, 5], [1331031600000, 6], [1331035200000, 4]]
}]

The first number in each array is the date-stamp, I think it is UTC. When I get the data that I need to put into the chart, I get it like this:
"2013-06-08T06:00:00.000-07:00"

My question is, what format is this? And how should I convert it to what I need for highstock / highcharts.

A:

Just throw that string into a Date() function and you should get it back as a Javascript Date object.
var myDate = new Date('2013-06-08T06:00:00.000-07:00');

To get it back as a formal UNIX timestamp, you just need to convert it back to a number, and divide by 1000 (as there are a thousand ms in a second), but it looks like you're looking for the ms value, not a formal UNIX timestamp.
Easiest way would be to use the + prefix operator.
var myUnixTimestamp = +myDate;
// 1370696400000

