[IronPython] IronPython strptime for %H

Alexey Borzenkov snaury at gmail.com
Thu Aug 24 06:26:01 CEST 2006


# 1.py
from System.Threading.Thread import CurrentThread
from System.Globalization import CultureInfo
CurrentThread.CurrentCulture = CultureInfo("en-US")

import time, datetime
d = time.strptime("July 3, 2006 At 0724 GMT", "%B %x, %Y At %H%M GMT")
print d

# ipy 1.py
Traceback (most recent call last):

  File D:\Alex\IronPython\1.py, line 6, in Initialize

  File , line 0, in ParseString##20

ValueError: The string was not recognized as a valid DateTime. There
is a unknown word starting at index 13.

data=July 3, 2006 At 0724 GMT, fmt=%B %x, %Y At %H%M GMT, to: MMMM'
'D', 'yyyy' At '%Hmm' GMT'

Why does it let % be in .NET format string (1.0 rc2)?

More information about the Ironpython-users mailing list