如何将Python time.struct_time对象转换为datetime.datetime对象?我有一个提供第一个库的图书馆,一个提供第二个库的图书馆。
3 回答

米脂
TA贡献1836条经验 获得超3个赞
像这样:
>>> structTime = time.localtime()
>>> datetime.datetime(*structTime[:6])
datetime.datetime(2009, 11, 8, 20, 32, 35)
添加回答
举报
0/150
提交
取消