2024-05-05 23:49:47 发布
网友
我有一系列采用这种格式的日期: 2021年9月10日星期五08:54:04-0500
我希望将它们转换为yyyymmdd和hhmmss(忽略-0500)。在python中有没有一种干净的方法可以有效地实现这一点
你想这样吗
import time time_string = time.strftime("%m/%d/%Y, %H:%M:%S") #you can use colon instead of slash to change style and also change position of hours minute and month etc print(time_string)
你想这样吗
相关问题 更多 >
编程相关推荐