Sets the date's seconds

Description

setSeconds(seconds)
Sets the date's seconds. Setting the seconds to a number greater than 59 also increments the minutes.

Example


      var myDate = new Date();
      /*w  w w  .j  av a  2s  .c o  m*/
      myDate.setSeconds(21);
      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