计算一年后的日期
<!DOCTYPE html> <html> <head> <title>日期计算</title> </head> <body>
<script type="text/javascript"> var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; var nowDate=new Date(); nowDate.setMonth(nowDate.getMonth()+12); document.write("Date 12 months ahead is "+nowDate.getDate()); document.write(" "+months[nowDate.getMonth()]); document.write(" "+nowDate.getFullYear());
</script> </body> </html>