【问题标题】:Add today's time to tomorrow's date js using moment.js使用 moment.js 将今天的时间添加到明天的日期 js
【发布时间】:2020-05-12 19:45:37
【问题描述】:
const today = new Date();
const tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 1);

【问题讨论】:

    标签: javascript typescript date time momentjs


    【解决方案1】:

    您可以像这样使用add 方法:

    const today = new Date();
    const tomorrow = moment(today).add(1, 'days').toDate()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-28
      • 1970-01-01
      • 2014-09-13
      • 1970-01-01
      • 2021-06-16
      • 2011-04-18
      相关资源
      最近更新 更多