views:

182

answers:

2

I have seen several questions with people asking about the same problem but none of the answers are helping me.

I'm receiving this error:

    pydev debugger: starting
Traceback (most recent call last):
>>>
  File "/usr/local/zend/apache2/htdocs/pyth/src/conn.py", line 23, in <module>
    userConnDate = datetime.strptime(data[1] + ' ' + data[2], "%y-%m-%d %H:%M:%S")
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/_strptime.py", line 330, in strptime
    (data_string, format))
ValueError: time data did not match format:  data=2010-03-11 08:35:25  fmt=%y-%m-%d %H:%M:%S

It looks fine to me, what is python seeing that I don't?

Thanks for you time.

+2  A: 

you are using %y (which matches a 2 digit year).
try with %Y, which matches a 4 digit year (like your 2010)

Corey Goldberg
+1  A: 

Try using the a capital Y - '%Y' to match a 4-digit year.

rlotun