I have a date in YYYYMMDD format and a time in HHMMSS format as strings in the 4th and 5th elements in a list. I.E.:
data[4] = '20100304'
data[5] = '082835'
I am creating an instance of datetime (in a field named generates) like this:
generatedtime = datetime.datetime(int(data[4][:4]),int(data[4][4:6]),int(data[4][6:]),int(data[5][:2]),int(data[5][2:4]),int(data[5][4:6]))
Given that the input format cannot change, is there a cleaner way I should be creating my instance of the datetime object?