首页 > 知道这是个日期的方法,但不知道是什么意思,做什么的?

知道这是个日期的方法,但不知道是什么意思,做什么的?

function getPreviousDate(date){
    var currentDate = Date.parse(date);
    currentDate = currentDate - 1000 * 60 * 60 * 24;
    var tmpDate = new Date();
    tmpDate.setTime(currentDate);
    return convertDateStr(tmpDate);
}

格式化日期


设置tmpDate时间对象为传入的data时间字符串时间的前一天。
后面这个convertDateStr(),看意思是转化为时间字符串?

【热门文章】
【热门文章】