标签:import lan 字符 imp pytho cond code 单位 lang
from datetime import datetime
b=‘2021-04-26 11:23:56‘
c = datetime.strptime(b, "%Y-%m-%d %H:%M:%S")
print(c) # datetime.datetime(2021, 4, 26, 11, 23, 56)
from datetime import datetime
a = datetime.now()
c = datetime.datetime(2021, 4, 26, 11, 23, 56)
d = (a-c).seconds
print(d) # 2401 (秒)
标签:import lan 字符 imp pytho cond code 单位 lang
原文地址:https://www.cnblogs.com/zhenzi0322/p/14704131.html