


Detailed explanation of the use of getTime() method in JavaScript_Basic knowledge
May 16, 2016 pm 03:56 PMThe javascript Date.getTime() method returns a value for the specified date according to the time corresponding to the universal time. The value returned by the getTime method is the number of milliseconds since 00:00:00 on January 1, 1970.
You can use this method to help specify a date and time to another Date object.
Grammar
Date.getTime()
Here are the details of the parameters:
- NA
Return value:
Returns the value corresponding to the specified date in universal time.
Example:
<html> <head> <title>JavaScript getTime Method</title> </head> <body> <script type="text/javascript"> var dt = new Date( "December 25, 1995 23:15:20" ); document.write("getTime() : " + dt.getTime() ); </script> </body> </html>
This will produce the following results:
getTime() : 819913520000

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to implement an online speech recognition system using WebSocket and JavaScript

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems

How to implement an online reservation system using WebSocket and JavaScript

How to use JavaScript and WebSocket to implement a real-time online ordering system

Simple JavaScript Tutorial: How to Get HTTP Status Code

JavaScript and WebSocket: Building an efficient real-time weather forecasting system

How to use insertBefore in javascript

How to get HTTP status code in JavaScript the easy way
