相关文章推荐
飞翔的感冒药  ·  Android ...·  2 月前    · 
干练的西装  ·  js ...·  1 月前    · 
爱喝酒的茶叶  ·  ubuntu 22.04 ssh ...·  2 年前    · 
安静的铅笔  ·  Responsividade | ...·  2 年前    · 
我给你举个例子吧!就拿当前时间来说,下面是代码
var now = new Date();
tomo = new Date((now/1000-86400*10)*1000);//先减去10天
var year = tomo.getYear();
var month = tomo.getMonth();//再减去一个月,当前月应该是tomo.getMonth()+1
var date = tomo.getDate();
month = (month<10)?"0"+month:month;
date = (date<10)?"0"+date:date;
var time = year+"/"+month+"/"+date;//最终得到的时间