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/setTime below:

setTime ยท WebPlatform Docs

setTime Summary

Sets the date and time value in the Date object.

Syntax
dateObj.setTime( milliseconds )
dateObj
Required. Any Date object.
milliseconds
Required. A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
Examples

The following example illustrates the use of the setTime method.

function SetTimeTest(newtime){
    var d, s;                  
    d = new Date();            
    s = "Current setting is ";
    s += d.toUTCString();
    return(s);                 
 }
Remarks

If milliseconds is negative, it indicates a date before 1970. The range of available dates is approximately 285,616 years from either side of 1970.

Setting the date and time with the setTime method is independent of the time zone.

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