每日一篇,非常齐全的网络时间戳API

本代码经测试可完美运行,有问题者可发送邮件到:CarsonRyan696@gmail.com 
console.show()
// 北京时间戳API
var response_beijing = http.get("https://time.is/t/?zh.0.347.2464.0p.480.43d.1574683214663.1594044507830.");
var beijing_Time = response_beijing.body.string();
var beijing_Time = beijing_Time.substring(0, 13)
console.info("北京时间戳为:" + beijing_Time)

//淘宝时间戳API
var response_taobao = http.get("http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp");
var taobao_Time = response_taobao.body.json();
console.info("淘宝时间戳为:" + taobao_Time.data.t);

//苏宁时间戳API
var response_suning = http.get("http://quan.suning.com/getSysTime.do");
var suning_Time = response_suning.body.json();
var suning_Time = suning_Time.sysTime2.replace(/-/g, "/") //将格式为:2020-07-06 22:00:00 转换为 2020/07/06 22:00:00  必须要转换否则无法转化时间戳
var suning_Time = new Date(suning_Time).getTime();
console.info("苏宁时间戳为:" + suning_Time);

// 拼多多时间戳API
var response_pinduoduo = http.get("http://api.pinduoduo.com/api/server/_stm");
var pinduoduo_Time = response_pinduoduo.body.json();
console.info("拼多多时间戳为:" + pinduoduo_Time.server_time);

// 京东时间戳API
var response_jingdong = http.get("https://a.jd.com//ajax/queryServerData.html");
var jingdong_Time = response_jingdong.body.json();
console.info("京东时间戳为:" + jingdong_Time.serverTime);

// 物美多点时间戳API
var response_duodian = http.get("https://appapis.dmall.com/static/queryUserCheckInfo.jsonp");
var duodian_Time = response_duodian.body.string();
var duodian_Time = duodian_Time.substring(48, 61)
console.info("物美多点时间戳为:" + duodian_Time)

// 华为商城时间戳API
var response_huawei = http.get("https://mbuy.vmall.com/getSkuRushbuyInfo.json");
var huawei_Time = response_huawei.body.json();
console.info("华为商城时间戳为:" + huawei_Time.currentTime)

// 得物时间戳API
var response_dewu = http.get("https://m.poizon.com/client/cold");
var dewu_Time = response_dewu.body.json();
console.info("得物时间戳为:" + dewu_Time.data.timestamp)

// 招行时间戳API
var response_zhaohang = http.post("https://act.cmbchina.com/ActShipMobile/api/wechat/getWechatAuth", {
    headers: {
        "Accept-Language": "zh-CN,zh;q=0.8",
        "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",
        "Host": "act.cmbchina.com",
        "Connection": "Keep-Alive",
        "Accept-Encoding": "gzip"
    },
    "requesUrl": ""
});
var response_zhaohang = response_zhaohang.body.json();
console.info("招行时间戳为:" + response_zhaohang.timestamp)

// 小米有品时间戳API
var response_xiaomi = http.get("https://tptm.hd.mi.com/gettimestamp");
var xiaomi_Time = response_xiaomi.body.string();
var xiaomi_Time = xiaomi_Time.split("=");
console.info("小米有品时间戳为:" + xiaomi_Time[1])

// 来自某自搭建网站时间API
var response_my = http.get("http://api.k780.com/?app=life.time&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json");
var my_Time = response_my.body.json();
console.info(my_Time.result.timestamp);  //输出时间戳
console.info(my_Time.result.datetime_1); //输出年月日   Example:2020-07-06 21:00:00
console.info(my_Time.result.datetime_2); //输出年月日   Example: 2020年07月06日 21时00分00秒
console.info(my_Time.result.week_1)      //输出数字星期 Example: 1
console.info(my_Time.result.week_2)      //输出星期     Example:星期一
console.info(my_Time.result.week_3)      //输出周几     Example: 周一
console.info(my_Time.result.week_4)      //输出英文星期  Example: Monday

// 国美时间戳API
var response_Tengine = http.get("https://im-platform.gome.com.cn/im-platform/system/serverTime.json?appId=gomeplus_pro");
var Tengine_Time = response_Tengine.body.json();
console.info("国美时间戳为:" + Tengine_Time.data.time)

// vivo官网时间戳API
var response_vivo = http.get("http://mshopact.vivo.com.cn/tool/config");
var vivo_Time = response_vivo.body.json();
console.info("Vivo商城时间戳为:" + vivo_Time.data.nowTime)

// 魅族官网时间戳API
var response_meizu = http.get("https://book.meizu.com/gettime.js");
var meizu_Time = response_meizu.body.string();
var meizu_Time = meizu_Time.substring(16, 26);
console.info("魅族时间戳为:" + meizu_Time);

//QQ时间戳API以及获取IP地址
var response_qq = http.post("http://vv6.video.qq.com/checktime",{
    "randnum":"0.45350576033883383",
    "guid":"0f5d85d631236102",
    "otype":"json"
});
var qq_Time = response_qq.body.string();
//获取时间和ip
var qq_Time = qq_Time.match(/\d+(.\d+)?/g);
var ip = qq_Time[1]+"."+qq_Time[2]
console.info("QQ时间戳为:" + qq_Time[0]);
console.info("您的IP为:" + ip);



你可能感兴趣的:(autojs,javascript)