I'm currently working with a bunch of lists, and I wanted to extract a certain element and set it to datetime format.
So I have a sample code below:
mylist = ['Bananas', 200, 500, 'Walmart', '201309', 10, 12, 44, 11, 43]
print datetime.strptime(''.join(mylist[4:5]), '%Y%m')
My question is, is there a better way of doing this?
My expected output is: 2013-09-01 00:00:00