这是我的代码:
$(function () {
function my_convert() {
data = [{"Index":"\/Date(1449161293876)\/","Value":0},{"Index":"\/Date(1449247693876)\/","Value":0},{"Index":"\/Date(1449334093876)\/","Value":0},{"Index":"\/Date(1449349200000)\/","Value":5}]//data from server
var arr = []
data.forEach(function (i) {
var my_date = new Date(parseInt(i.Index.substr(6))).setHours(0, 0, 0, 0)// setHours(3, 0, 0, 0)
arr.push([Number(my_date), i.Value])
})
return arr //[ [1449003600000,0], [1449090000000,21], [1449176400000,0]]
}
我试图绘制图表(Highstock) 为什么当我试图设置时间" setHours(0,0,0,0)"我得到了(21:00:00)?我必须设置这样的时间" setHours(3,0,0,0)"得到(00:00:00)为什么?
这是关于jsfiddle的代码:https://jsfiddle.net/Yura602/z0z7x4nt/4/
这是时间转换器(如果需要):http://www.epochconverter.com/