Sets the milliseconds representation of the date, thus changing the entire date.
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.