Error in date formatting

0

I have the following example date format:

May 7 10:32

What would be the date format that you should use in Python to recognize it? I have used the following code, it is worth mentioning that this is the line that python tells me that it has an error:

date_time="%b-%d %I:%M"%(self.year,file['date'],file['time'])
registro['datetime'] =datetime.strptime(date_time,"%b-%d %I:%M")

The error is as follows:

File "c:\app\appFac\applib\util\tarificado.py", line 831, in processRegistry
 'introducir el código aquí'date_time="%b-%d %I:%M"%(self.year,file['date'],file['time'])
KeyError: 'date'
    
asked by Grindor 08.05.2018 в 01:56
source

0 answers