time.strptime() for different languages

Adam Monsen haircut at gmail.com
Wed Aug 31 17:02:24 EDT 2005


No, this doesn't seem to work, and I can't find anything in the
documentation indicating that it should.

>>> import os
>>> os.getenv('LANG')
'nl_NL'
>>> import time
>>> time.strptime("10 augustus 2005 om 17:26", "%d %B %Y om %H:%M")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/_strptime.py", line 292, in strptime
    raise ValueError("time data did not match format:  data=%s  fmt=%s"
%
ValueError: time data did not match format:  data=10 augustus 2005 om
17:26  fmt=%d %B %Y om %H:%M

-- 
Adam Monsen
http://adammonsen.com/




More information about the Python-list mailing list