python3 取北京时间

import datetime,urllib.request
intime = str(urllib.request.urlopen("http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp").read().decode())
one = intime[:intime.rfind('"')]
times = datetime.datetime.fromtimestamp(int(one[one.rfind('"')+1:-3]))
print(times)
posted @ 2020-11-10 15:02  a_new_soul(黑格子)  阅读(416)  评论(0)    收藏  举报