Sets the milliseconds representation of the date

Description

setTime(milliseconds)
Sets the milliseconds representation of the date, thus changing the entire date.

Example


      var myDate = new Date();
      /*from  ww w  . j  a v a2 s .c om*/
      myDate.setTime(123);
      console.log(myDate.toString());
      

The code above generates the following result.





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window