setDate()
JavaScript日期setDate()方法根据本地时间设置指定日期的月中某天。
语法 (Syntax)
Date.setDate( dayValue )
参数 (Parameter)
dayvalue - 1到31之间的整数,表示该月的某天。
例子 (Example)
var dt = new Date( "Aug 28, 2008 23:30:00" );
dt.setDate( 24 );
console.log( dt )
输出 (Output)
Sun Aug 24 2008 23:30:00 GMT+0530 (India Standard Time)