let TimeHandle = function (time) {
// 转换为式分秒
let h = parseInt(time / 60 / 60 % 24)
h = h < 10 ? '0' + h : h
let m = parseInt(time / 60 % 60)
m = m < 10 ? '0' + m : m
let s = parseInt(time % 60)
s = s < 10 ? '0' + s : s
// 作为返回值返回
if (h == "00") {
return m + ':' + s
} else {
return h + ':' + m + ':' + s
}
}
//今天
var Dates = new Date();
var Y = Dates.getFullYear();
var M = Dates.getMonth() + 1;
var D = Dates.getDate();
var times = Y + (M < 10 ? "-0" : "-") + M + (D < 10 ? "-0" : "-") + D;
//昨天
var yes = new Date(new Date() - 24 * 60 * 60 * 1000);
var yY = yes.getFullYear();
var yM = yes.getMonth() + 1;
var yD = yes.getDate();
var ytimes = yY + (yM < 10 ? "-0" : "-") + yM + (yD < 10 ? "-0" : "-") + yD;