Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在字符串中有日期:
mystring = "2013-10-25 07:53:07.367857"
我可以将此字符串转换为日期时间对象吗?
是的,你想要
from datetime import datetime datetime.strptime(mystring, "%Y-%m-%d %H:%M:%S.%f")