javascript 时间加法及时间和String格式化

var myDate = new Date();
var interval = 1 * 24 * 60 * 60 * 1000;
myDate.setTime(myDate.getTime() - interval);
var s_begindate = myDate.format('Y-m-d');
var enddate = new Date();
var s_enddate = enddate.format('Y-m-d');

你可能感兴趣的:(JavaScript,Date,String)