Javascript setdate () method http://www.w3school.com.cn/js/jsref_setDate.asp
Javascript date object reference manual
Definition and usage
The setdate () method is used to set a day of a month.
Syntax
dateObject.setDate(day)
Parameters |
Description |
Day |
Required. Represents a value (1 ~ 31 ). |
Return Value
The millisecond representation of the adjusted date. Before ecmascript standardization, this method returns nothing.
Tips and notes:
Note: This method is always used in combination with a date object.
Instance
In this example, we will use the setdate () method to set the day of the current month to 15:
<script type="text/javascript">var d = new Date()d.setDate(15)document.write(d)</script>
Output:
Sun Jan 15 2012 21:04:52 GMT + 0800 (China Standard Time)
Tiy
-
Setdate ()
-
How to Use setdate () to set a day of the current month.
Javascript date object reference manual