Sets the day of the month for the date

Description

setDate(date)
Sets the day of the month for the date. If the date is greater than the number of days in the month, the month value also gets increased.

Example


/*from  www.ja  va 2  s. co m*/
      var myDate = new Date();

      myDate.setDate(12);
      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