A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Date/now below:

now ยท WebPlatform Docs

now Summary

Gets the current date and time.

Syntax
Date.now()
Return Value

The number of milliseconds between midnight, January 1, 1970, and the current date and time.

Examples

The following example illustrates the use of the now method.

var start = Date.now();
 var response = prompt("What is your name?", "");
 var end = Date.now();
 var elapsed = (end - start) / 1000;
 document.write("You took " + elapsed + " seconds" + " to type: " + response);

 
 
Remarks

The getTime method returns the number of milliseconds between January 1, 1970, and a specified date.

For information about how to calculate elapsed time and compare dates, see Date and Time Calculations (Windows Scripting - JScript).

See also Other articles Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4