python时间处理
a1 = "2019-5-10"
# 先转换为时间数组
timeArray = time.strptime(a1, "%Y-%m-%d")
# 转换为时间戳
timeStamp = int(time.mktime(timeArray))
dt = datetime.fromtimestamp(timeStamp)
# 当前时间
timeStamp = time.time()
dt2 = datetime.fromtimestamp(timeStamp)
a = dt2 - dt
b = dt - dt2
print(dt2 - dt)
print(dt - dt2)