datetime.datetime.strptime problem

Posted by Rahul99 on Stack Overflow See other posts from Stack Overflow or by Rahul99
Published on 2010-03-17T06:19:55Z Indexed on 2010/03/17 16:31 UTC
Read the original article Hit count: 214

Filed under:
|

My input string is '16-MAR-2010 03:37:04' and i want to store it as datetime.

I am trying to use:

db_inst.HB_Create_Ship_Date = datetime.strptime(fields[7]," %d-%b-%Y %H:%M:%S ") 
fields[7] = '16-MAR-2010 03:37:04' 

I am getting an error:

::ValueError: time data '16-MAR-2010 03:37:04' does not match format ' %d-%b-%Y %H:%M:%S ' 

I am running Python version --EDIT-ME-- on the --EDIT-ME-- operating system.

My locale is --EDIT-ME--.

Which format do I have to use?

© Stack Overflow or respective owner

Related posts about python

Related posts about strptime