Home > Web Front-end > JS Tutorial > body text

Javascript millisecond usage examples_javascript skills

WBOY
Release: 2016-05-16 16:15:49
Original
1559 people have browsed it

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();//当前时间的毫秒数
Copy after login

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, "/")));//指定时间的毫秒数
Copy after login

I hope this article will be helpful to everyone’s JavaScript programming design.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template