[IronPython] datetime.strptime is missing in IronPython?

Vernon Cole vernondcole at gmail.com
Tue Jun 8 18:59:35 CEST 2010


My error: The Python 2.6.5 documentation says:
v v v v

> classmethod datetime.strptime(date_string, format)¶
>
>    Return a datetime corresponding to date_string, parsed according to
> format. This is equivalent to datetime(*(time.strptime(date_string,
> format)[0:6])). ValueError is raised if the date_string and format can’t be
> parsed by time.strptime() or if it returns a value which isn’t a time tuple.
> See section strftime() and strptime() Behavior.
>
>    New in version 2.5.
>
^ ^ ^ ^
I will include this information as a comment on the codeplex 17470 workitem.

Note that the equivalent code using "time.strptime()" is included in the
above definition.
--
Vernon Cole

On Mon, Jun 7, 2010 at 11:27 PM, Tony Meyer <tony.meyer at gmail.com> wrote:
> 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
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100608/063561ee/attachment.html>


More information about the Ironpython-users mailing list