| getMilliseconds() The getMilliseconds() method is used to return a number between 0 and 999 which represents the number of seconds after the zero hour of midnight. The date for this calculation is taken from the date specified by your operating system, and used by the Date object. syntax: dateName.getDate() EXAMPLE dateObject = new Date(); document.write("The date is: " + dateObject.getMilliseconds()); The example shows the creation of a new Date object, called dateObject. It is then used within a document.write statement, with the getMilliseconds() method to display its value after the string of text. |