发布网友 发布时间:2022-04-23 14:31
共2个回答
热心网友 时间:2023-10-18 14:08
timestamp
时间戳类型:自1970年1月1日(00:00:00 GMT)以来的秒数
----------------------------------------------
>>> time.time()
1355749338.05917
可以尝试转化为str格式看日期字段是否一致
timestamp = time.time()
time_tuple = time.localtime(timestamp)
time_str = time.strftime("%Y-%m-%d", time_tuple)
比较time_str就可以了
热心网友 时间:2023-10-18 14:08
>>> import time
>>> t1 = time.time()
>>> t2 = time.time()
>>> t1_str = time.strftime("%Y-%m-%d", time.localtime(t1))
>>> t2_str = time.strftime("%Y-%m-%d", time.localtime(t2))
>>> t1_str == t2_str
True
热心网友 时间:2023-10-18 14:08
timestamp
时间戳类型:自1970年1月1日(00:00:00 GMT)以来的秒数
----------------------------------------------
>>> time.time()
1355749338.05917
可以尝试转化为str格式看日期字段是否一致
timestamp = time.time()
time_tuple = time.localtime(timestamp)
time_str = time.strftime("%Y-%m-%d", time_tuple)
比较time_str就可以了
热心网友 时间:2023-10-18 14:08
>>> import time
>>> t1 = time.time()
>>> t2 = time.time()
>>> t1_str = time.strftime("%Y-%m-%d", time.localtime(t1))
>>> t2_str = time.strftime("%Y-%m-%d", time.localtime(t2))
>>> t1_str == t2_str
True