如何使用JavaScript在日期中增加月份数?
要在日期中添加月份数,请先使用getMonth()方法获取月份,然后添加月份数。
示例
您可以尝试运行以下代码来添加多个月
<!DOCTYPE html>
<html>
<body>
<script>
var d, e;
d = new Date();
document.write(d);
e = d.getMonth()+1;
document.write("<br>Incremented month = "+e);
</script>
</body>
</html>热门推荐
10 良师益友祝福语简短
11 宝宝祝福语诗意简短 古文
12 同事们生日祝福语简短
13 毕业英语祝福语大全简短
14 新年的生日祝福语简短
15 宝宝生病简短祝福语大全
16 关于扬州的祝福语简短
17 同事调动的祝福语简短
18 朋友药店开业祝福语简短