python+selenium+new——格式化日期


import time


picture_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime(time.time())) print(picture_time) # 2020-02-15-19-18-38 #-------------------------------------------------------------------------------- picture_time2 = time.strftime("%Y-%m-%d", time.localtime(time.time())) print(picture_time2) # 2020-02-15 #-------------------------------------------------------------------------------- picture_time3 = time.strftime("%H-%M-%S", time.localtime(time.time())) print(picture_time3) # 2020-02-15

 

 

执行结果:

 

2020-02-15-19-25-51
2020-02-15
19-25-51

 

posted @ 2020-02-15 19:29  小白龙白龙马  阅读(199)  评论(0编辑  收藏  举报