I have a date string defined as follows:
datestr = '2011-05-01'
I want to convert this to a datetime object, so I used the following code
dateobj = datetime.datetime.strptime(datestr,'%Y-%m-%d') print dateobj
But what is printed: 2011-05-01 00:00:00. I just need 2011-05-01. What needs to be changed in my code?
thanks
james source share