码迷,mamicode.com
首页 > 编程语言 > 详细

python3 日期时间

时间:2020-03-15 09:52:54      阅读:49      评论:0      收藏:0      [点我收藏+]

标签:port   bsp   date   strip   span   class   %s   时间   imp   

1 from datetime import datetime
2 
3 t1 = 22:21:30
4 t2 = 23:21:25
5 
6 s = datetime.striptime(t1, %H:%M:%S)
7 e = datetime.striptime(t2, %H:%M:%S)
8 
9 print((t2-t1).total_seconds()

 

python3 日期时间

标签:port   bsp   date   strip   span   class   %s   时间   imp   

原文地址:https://www.cnblogs.com/jpapplication/p/12495926.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!