[IronPython] Bug in time.strptime?
dinov at exchange.microsoft.com
Wed Jul 5 18:44:01 CEST 2006
Sorry for the delay - it was a really long weekend for many of us.
Currently our strptime implementation is mostly built by translating from Python formatting codes to .NET formatting codes and then calling the .NET Formatting APIs. There's apparently a difference here in that .NET doesn't allow random extra characters in its formatting strings, and CPython does.
I've opened a bug on CodePlex (#776, http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=776) to track this. We'll try and get to this for 1.0 but I'm not entirely sure we'll be able to get it done in time.
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Raath
Sent: Tuesday, July 04, 2006 10:23 AM
To: users at lists.ironpython.com
Subject: Re: [IronPython] Bug in time.strptime?
Just wondering if this post slipped in under the radar - can anyone please confirm whether this is a bug, or if I could be using IronPython differently to achieve the same thing?
I need to be able to interpret non-standard dates (the format of which I can't dictate) and in CPython this is possible using the code below.
I'm getting an exception in IronPython which I don't get in CPython.
>From the CPython console window:
>>> import time, datetime
>>> d = time.strptime("July 3, 2006 At 0724 GMT", "%B %d, %Y At %H%M GMT")
>>> print d
(2006, 7, 3, 7, 24, 0, 0, 184, -1)
>From IronPython, a similar set of statements:
engine.Execute("d = time.strptime(""July 3, 2006 At 0724 GMT"", ""%B %d, %Y At %H%M GMT"")")
results in this exception:
The string was not recognized as a valid DateTime. There is a unknown word starting at index 13.
The word starting at index 13 is the "At" but the format string provided should tell strptime how to interpret it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users