关于js中date用法(不断整理)

来源:互联网 发布:linux源代码在线阅读 编辑:程序博客网 时间:2024/05/17 09:19

var date=new Date();

date.setDate(date.getMonth()+num);

第二行中,想要增加月就用date.getMonth(),要增加日用date.getDate(), num为增加的时间段。


0 0