Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:Date:setDate

From MDC


Contents

[edit] Summary

Sets the day of the month for a specified date according to local time.

Method of Date
Implemented in: JavaScript 1.0, NES 2.0
ECMA Version: ECMA-262

[edit] Syntax

setDate(dayValue)

[edit] Parameters

dayValue 
An integer from 1 to 31, representing the day of the month.

[edit] Examples

[edit] Example: Using setDate

The second statement below changes the day for theBigDay to July 24 from its original value.

theBigDay = new Date("July 27, 1962 23:30:00")
theBigDay.setDate(24) 

[edit] See Also

getDate, setUTCDate