I have a date string which is in the form of 2016-03-15 14:41:48.901013+05:30
. I want to change it to a datetime object in the same format i.e 2016-03-17 14:41:48.901013+05:30
. Please help me in doing this.
I am using django 1.8.
I have a date string which is in the form of 2016-03-15 14:41:48.901013+05:30
. I want to change it to a datetime object in the same format i.e 2016-03-17 14:41:48.901013+05:30
. Please help me in doing this.
I am using django 1.8.
Install dateutil
pip install python-dateutil
Code:
from dateutil import parser
dt = parser.parse("2016-03-15 14:41:48.901013+05:30")