Reputation: 19164
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?
Upvotes: 0
Views: 411
Reputation: 9826
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'))
Upvotes: 4