August 1999
Intermediate to advanced
1488 pages
72h 53m
English
date.setTime(milliseconds)
The setTime() method sets the time in the Date object to the argument milliseconds, an integer representing the number of milliseconds between midnight January 1, 1970 (GMT) to the desired date and time.
The code in Listing 6.99 uses the setTime() method to set the date to November, 17, 2005 using milliseconds.
<html> <script language="JavaScript"> <!–– Hide //Create a Date object. theDate = new Date(); //Set the date to Nov. 17, 2005 theDate.setTime(1132203600000); //display the date document.write(theDate.toString()); //Hide End ––> ... |
Read now
Unlock full access