简体   繁体   English

将带时间的日期格式转换为毫秒

[英]Convert date format with time to millisec

I have the date format: "2015-09-28T10:15:00.000Z" .我有日期格式: "2015-09-28T10:15:00.000Z"

In Highstocks I have the structure:在 Highstocks 我有这样的结构:

[
  [date, value], ["2015-09-28T10:15:00.000Z", 1080]
]

How do I convert the dateformat to millisec, so that Hightocks can read it?如何将日期格式转换为毫秒,以便 Hightocks 可以读取它?

The other questions didn´t lead me to an answer.其他问题并没有让我得到答案。

Date.prototype.getTime() returns the time in milliseconds. Date.prototype.getTime()以毫秒为单位返回时间。

millisec = new Date("2015-09-28T10:15:00.000Z").getTime();

The result is: 1443435300000结果是: 1443435300000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM