python3 获取两个时间戳相差多少秒
2021-01-26 19:13
阅读:551
标签:date control puts seconds pre print mes code cond
code
import time import datetime t1=time.time() time.sleep(5) t2=time.time() print("相差",(datetime.datetime.fromtimestamp(t2)-datetime.datetime.fromtimestamp(t1)).seconds,"秒")
outputs
macname@MacdeMBP Desktop % python3 test.py 相差 5 秒 macname@MacdeMBP Desktop %
python3 获取两个时间戳相差多少秒
标签:date control puts seconds pre print mes code cond
原文地址:https://www.cnblogs.com/sea-stream/p/12851675.html
上一篇:JAVA各种加密与解密方式
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:python3 获取两个时间戳相差多少秒
文章链接:http://soscw.com/index.php/essay/47400.html
文章标题:python3 获取两个时间戳相差多少秒
文章链接:http://soscw.com/index.php/essay/47400.html
评论
亲,登录后才可以留言!