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.
我有日期
'Apr, 2012'
我想将其转换为“mx datetime”对象。
谁能告诉我如何转换相同的?
您可以使用 dateutil.parser 将日期解析为 python datetime 对象:
from dateutil.parser import parse from mx.DateTime import DateFrom date = DateFrom(parse('Apr, 2012'))