Lose the spaces at the front and back of your format. I thought that strptime was documented to vary depending on the whims of whoever wrote the C runtime for your box. However it seems I'm wrong. Which would mean that there's a bug in Python.
Python 2.6.4 on Windows doesn't like leading trailing spaces; see below.
*x users, what do you find?
In the meantime, use the lowest common denominator -- lose the spaces. You may also have a locale problem, as Adam mentioned.
With spaces:
>>> datetime.datetime.strptime('16-MAR-2010 03:37:04'," %d-%b-%Y %H:%M:%S ")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\python26\lib\_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data '16-MAR-2010 03:37:04' does not match format ' %d-%b-%Y %H
:%M:%S '
Without spaces:
>>> datetime.datetime.strptime('16-MAR-2010 03:37:04',"%d-%b-%Y %H:%M:%S")
datetime.datetime(2010, 3, 16, 3, 37, 4)
>>>