Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
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.
I have date as
'Apr, 2012'
I want to convert it to the "mx datetime" object.
Can anyone tell me how to convert the same?
datetime
strptime
datetime.datetime.strptime
You can use dateutil.parser to parse dates to python datetime objects:
from dateutil.parser import parse from mx.DateTime import DateFrom date = DateFrom(parse('Apr, 2012'))
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
datetimemodule.strptimefunction works the same as the python stdlib'sdatetime.datetime.strptimefunction, so this should be a very straight forward operation.