[IronPython] datetime.strptime is missing in IronPython?

Tony Meyer tony.meyer at gmail.com
Tue Jun 8 07:27:03 CEST 2010


On Tue, Jun 8, 2010 at 4:46 PM, Vernon Cole <vernondcole at gmail.com> wrote:
> The issue tracker for CPython  [if I read it correctly] lists
> datetime.strptime as a new feature to be supported in python 2.7 and
> 3.2. It is not documented in the Python 2.6 manual.

datetime.datetime.strptime is definitely in CPython 2.5 and 2.6:

"""
tony-meyers-imac:~ tameyer$ python
Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.strptime("2010 06 08", "%Y %m %d")
datetime.datetime(2010, 6, 8, 0, 0)
"""

The only IP 2.6 I have handy is trypython.org, and the above code does
fail there (no copy and paste from the site unfortunately).

This is a known bug (so go vote!):

http://ironpython.codeplex.com/workitem/17470

Cheers,
Tony



More information about the Ironpython-users mailing list