function getInternetTime_taobao(){
let response = http.httpGet(‘http://api.m.taobao.com/rest/api3.do’
,{api:‘mtop.common.getTimestamp’},1000
,{“User-Agent”:‘Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 UBrowser/6.2.4098.3 Safari/537.36’})
if(response){
try {
let object = JSON.parse(response);
if(object){
return new Date(parseInt(object.data.t))
}
}catch (e) {
return null;
}
}
return null;
}
logd(getInternetTime_taobao());
exit()
ec获取网络时间
最新推荐文章于 2024-05-15 20:59:05 发布