This commit is contained in:
lxk0301
2021-01-04 13:51:16 +08:00
parent 27117a0b17
commit 32fab79c15

View File

@@ -299,11 +299,9 @@ function getJDServerTime() {
}) })
} }
async function get_diff_time() { async function get_diff_time() {
console.log(`本机时间戳 ${Date.now()}`) // console.log(`本机时间戳 ${Date.now()}`)
console.log(`京东服务器时间戳 ${await getJDServerTime()}`) // console.log(`京东服务器时间戳 ${await getJDServerTime()}`)
console.log(Date.now() - await getJDServerTime()) return Date.now() - await getJDServerTime();
let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000;
return nowTime - await getJDServerTime();
} }
function jsonParse(str) { function jsonParse(str) {
if (typeof str == "string") { if (typeof str == "string") {