zoukankan      html  css  js  c++  java
  • js 获取当前日后_未来_30天每一天日期

    js 获取当前日后_未来_30天每一天日期

    // js 获取当前日期到之后一个月30天的日期区间
    var dateList = [];
    let startDate = new Date();
    let endDate = new Date();
    endDate.setDate(startDate.getDate() + 30);
    while ((endDate.getTime() - startDate.getTime()) >= 0) {
        let month = (startDate.getMonth() + 1).toString().length === 1 ? "0" + (startDate.getMonth() + 1).toString() : (
            startDate.getMonth() + 1);
        let day = startDate.getDate().toString().length === 1 ? "0" + startDate.getDate() : startDate.getDate();
        dateList.push(month + "-" + day);
        startDate.setDate(startDate.getDate() + 1);
    }
    console.log(dateList)
    // ["11-06", "11-07", "11-08", "11-09", "11-10", "11-11", "11-12", "11-13", "11-14", "11-15", "11-16", "11-17", "11-18", "11-19", "11-20", "11-21", "11-22", "11-23", "11-24", "11-25", "11-26", "11-27", "11-28", "11-29", "11-30", "12-01", "12-02", "12-03", "12-04", "12-05", "12-06"]
  • 相关阅读:
    C#与C++与互操作
    WPF GridView动态添加项并读取数据
    C#使用消息队列(MSMQ)
    使用代码浏览WPF控件模版
    PowerShell将运行结果保存为文件
    opencv + ffmpeg
    vmware
    HttpComponents Downloads
    pytorch 安装
    opencv 3.4.0 的编译
  • 原文地址:https://www.cnblogs.com/wn798/p/12016744.html
Copyright © 2011-2022 走看看