今天教大家一个获取当前时间API的方法
我们经常要获取系统当前时间,但是如果通过前端去 new Date() 获取的是当前电脑的时间。下面提供几个大公司的获取时间的API 。
苏宁易购获取当前时间API
url:https://f./api/ct.do
返回值:
{"api": "time","code": "1","currentTime": 1592663735507,"msg": ""}
京东获取当前时间API
url://ajax/queryServerData.html
返回值:
{"serverTime": 1592663800521}
淘宝获取当前时间API
url:http://api./rest/api3.do?api=mon.getTimestamp
返回值:
{"api": "mon.getTimestamp","v": "*","ret": ["SUCCESS::接口调用成功"],"data": {"t": "1592663852058"}}
腾讯获取当前时间API
url:http://vv./checktime?otype=json
返回值:
QZOutputJson={"s":"o","t":1592663920,"ip":"113.246.187.221","pos":"---","rand":"HTYY3wMs_y5_3F_XTi-KKg=="};
这个API 还返回当前IP,只不过t
表示时间,但是不是13位的时间戳。
如果觉得《获取当前北京时间API》对你有帮助,请点赞、收藏,并留下你的观点哦!