import datetime
str2datetime = lambda x: datetime.datetime.strptime(x, "%Y-%m-%d %H:%M:%S")
datetime2str = lambda x: datetime.datetime.strftime(x, "%Y-%m-%d %H:%M:%S")
timestamp2datetime = lambda x: datetime.datetime.fromtimestamp(int(x[:10])
## datetime2timestamp:
#.timestamp()
python时间格式转换
最新推荐文章于 2023-04-28 15:07:50 发布