获取当前时间,时间一天天递减

358 ℃
function getDate(index) {
    var date = new Date(); //当前日期
    var newDate = new Date();
    newDate.setDate(date.getDate() + index); //官方文档上虽然说setDate参数是1-31,其实是可以设置负数的
    var time = newDate.getFullYear() + "/" + (newDate.getMonth() + 1) + "/" + newDate.getDate();
    return time;
}

function getDate2(index) {
    var date = new Date(); //当前日期
    var newDate = new Date();
    newDate.setDate(date.getDate() + index); //官方文档上虽然说setDate参数是1-31,其实是可以设置负数的
    var time = (newDate.getMonth() + 1) + "-" + newDate.getDate();
    return time;
}

//获取时间递减
data: [getDate2(-7), getDate2(-6), getDate2(-5), getDate2(-4), getDate2(-3), getDate2(-2), getDate2(-1)]

el-table合并行的通用方法(附js代码)

vue前端分页功能实现代码(附js代码)

el-table利用:row-style="rowClass"设置指定行变色

一款基于Vue.js的开源UI组件库——View Design

一款免费开源的 JavaScript 数据库——PouchDB

上面是“获取当前时间,时间一天天递减”的全面内容,想了解更多关于 内容,请继续关注web建站教程。

当前网址:https://m.ipkd.cn/webs_160.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

php如何使用var_dump函数打印变量的类型和值
网站优化SEO双标题有什么用?
SEO问答:如何提高域名的信任度维度
帝国CMS技巧之模板留言板增加自定义字段教程
js手机号码、电话号码正则表达式最新匹配