扫码一下
查看教程更方便
setfullyear()方法根据本地时间设置指定日期的年份。
这个方法可用于设置月份及月份中的一天。
该方法的语法如下:
date.setfullyear(yearvalue[, monthvalue[, dayvalue]])
如果未指定 monthvalue 和 dayvalue 参数,则使用从 getmonth 和 getdate 方法返回的值。
1970年1月1日午夜至调整过日期的毫秒。
所有主要浏览器都支持 setfullyear() 方法
javascript setfullyear method
输出结果:
mon aug 28 2000 23:30:00 gmt 0800 (中国标准时间)