Javascript examples for Date:getTime
The getTime() method returns the number of milliseconds between midnight of January 1, 1970 and the specified date.
None
A Number, representing the number of milliseconds since midnight January 1, 1970
The following code shows how to return the number of milliseconds since 1970/01/01:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w ww. j a v a 2 s . co m var d = new Date(); var n = d.getTimezoneOffset(); document.getElementById("demo").innerHTML = n; } </script> </body> </html>