Home > Article > Web Front-end > Javascript millisecond usage examples_javascript skills
The example in this article describes the usage of Javascript milliseconds. Share it with everyone for your reference. The details are as follows:
Milliseconds are the number of milliseconds between the specified date and time and midnight on January 1, 1970 (GMT time).
1. The number of milliseconds of the current system time
var myData = new Date(); var times = myData.getTime();//当前时间的毫秒数
2. The number of milliseconds in the specified time
var time = "2014-02-27 11:50:21"; var times = Date.parse(new Date(time.replace(/-/g, "/")));//指定时间的毫秒数
I hope this article will be helpful to everyone’s JavaScript programming design.