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

562 ℃
Trae:新一代免费的AI编程工具
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)]

Qwen3.6-Plus编程模型 - 阿里通义重磅Agent编程模型,百万上下文+超强编码智能体

京东JoyMed医疗大模型 - 里程碑级医疗多模态大模型,重新定义AI诊疗新范式

小米OmniVoice官网 - 小米K2-Fsa重磅TTS模型,600+语言+极速克隆

TimelessHome.AI官网 - 一款AI室内设计与虚拟家居布置平台

SuperMegaFit官网 - 集健身数据、血液分析、营养管理于一体

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

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

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

生活小工具

收录了万年历、老黄历、八字智能排盘等100+款小工具!生活小工具

猜你喜欢