def fun(x):
# 格式化一下,去掉datetime后面的毫秒值
x = '{:%Y-%m-%d %H:%M:%S}'.format(x.time)
return datetime.datetime.fromisoformat(x)
python 格式化去掉datetime后面的毫秒值
最新推荐文章于 2023-11-07 09:02:52 发布
def fun(x):
# 格式化一下,去掉datetime后面的毫秒值
x = '{:%Y-%m-%d %H:%M:%S}'.format(x.time)
return datetime.datetime.fromisoformat(x)