var today=new Date(); // 获取今天时间
today.setDate(today.getDate() + 7); // 系统会自动转换
下面是date类提供的三个你可能生成字符串用到的函数:
getDate() 从 Date 对象返回一个月中的某一天 (1 ~ 31)。
getMonth() 从 Date 对象返回月份 (0 ~ 11)。
getFullYear() 从 Date 对象以四位数字返回年份。

相关文章:

  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案