function ARGBtoRGBA(num) {
num >>>= 0;
let b = num & 0xFF,
g = (num & 0xFF00) >>> 8,
r = (num & 0xFF0000) >>> 16,
a = ( (num & 0xFF000000) >>> 24 ) / 255 ;
return "rgba(" + [r, g, b, a].join(",") + ")";
}
let x = ARGBtoRGBA(4280362283);
console.log(x);
// 输出结果:rgba(33,37,43,1)
let startdate = "2019-04-01T04:00:00.000Z";
let endate = "2019-04-08T04:00:00.000Z";
let days = (new Date(endate) - new Date(startdate)) / 1000 / 60 / 60 / 24;
console.log(days);
// 输出结果 7
第一种和第二种是获取了当前毫秒的时间戳 ,最后一种获取的时间戳是把毫秒改成000显示
//方法一
let timestamp = (new Date()).getTime();
console.log(timestamp); //1555466794193
//方法二
let timestamp2 = (new Date()).valueOf();
console.log(timestamp2); //1555466794195
//方法三
let timestamp3 = Date.parse(new Date());
console.log(timestamp3);//1555466794000