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
First pip install python-dateutil then do:
pip install python-dateutil
>>> from dateutil.parser import parse >>> dt = parse('19 Nov 2015 18:45:00.000') >>> dt.year 2015 >>> dt.month 11 >>> dt.day 19 >>> dt.hour 18 >>> dt.minute 45 >>> dt.second 0