I have to split a date time which I get from a software in the below format to separate variables (year,month,day,hour, min,sec)
19 Nov 2015 18:45:00.000
df2['invoice_date']=pd.to_datetime(df2.invoice_date, format='%m/%d/%Y %H:%M')
df2.insert(loc=5, column='month', value=df2.invoice_date.dt.month)
# +1 to make Monday=1.....until Sunday=7
df2.insert(loc=6, column='day', value=(df2.invoice_date.dt.dayofweek)+1)
df2.insert(loc=7, column='hour', value=df2.invoice_date.dt.hour)