[IronPython] datetime.strptime is missing in IronPython?

Peter Masiar peter.masiar at gmail.com
Mon Jun 7 21:56:42 CEST 2010


Seems like datetime in Ironpython has only strftime, but no strptime?

IronPython 2.0.3 (2.0.0.0) on .NET 2.0.50727.3603
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> dir(datetime.datetime)
['CompareTo', '__add__', '__class__', '__delattr__', '__doc__', '__eq__', '__ge_
_', '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__l
e__', '__lt__', '__ne__', '__new__', '__nonzero__', '__radd__', '__reduce__', '_
_reduce_ex__', '__repr__', '__rsub__', '__setattr__', '__str__', '__sub__', 'ast
imezone', 'combine', 'ctime', 'date', 'day', 'dst', 'fromordinal', 'fromtimestam
p', 'hour', 'isocalendar', 'isoformat', 'isoweekday', 'max', 'microsecond', 'min
', 'minute', 'month', 'now', 'replace', 'resolution', 'second', 'strftime', 'tim
e', 'timetuple', 'timetz', 'today', 'toordinal', 'tzinfo', 'tzname', 'utcfromtim
estamp', 'utcnow', 'utcoffset', 'utctimetuple', 'weekday', 'year']
>>>

Or do I have wrong/obsolete IronPython? Which one has datetime.strptime()?
What I am missing?

What is recommended way in IronPython to parse date/time string back
to date object?

Thanks!
-- 
-----
Peter Masiar



More information about the Ironpython-users mailing list