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
As an alternative to wim's answer, if you don't want to install a package, you can do it like so:
import datetime
s = "19 Nov 2015 18:45:00.000"
d = datetime.datetime.strptime(s, "%d %b %Y %H:%M:%S.%f")
print d.year
print d.month
print d.day
print d.hour
print d.minute
print d.second
This outputs:
2015
11
19
18
45
0
This utilizes strptime to parse the string.