Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Date Time split in python

import datetime 

string = "19 Nov 2015  18:45:00.000"
date = datetime.datetime.strptime(string, "%d %b %Y  %H:%M:%S.%f")

print date

#OR you can do

from dateutil.parser import parse
date = parse('19 Nov 2015  18:45:00.000')


# To access the desired individual Variables separately   (year,month,day,hour, min,sec):
date.year

date.month

date.day

date.hour

date.minute

date.second


#OR
print date.year
print date.month
print date.day
print date.hour
print date.minute
print date.second
 
PREVIOUS NEXT
Tagged: #Date #Time #split #python
ADD COMMENT
Topic
Name
1+8 =