I am converting string to date like this:
date=request.GET.get('date','') if date: date = datetime.strptime(date, "%m/%d/%Y") print date
Prints:
2014-08-08 00:00:00
How can I get the date without 00:00:00?
You have a "datetime" object, hence part of the time.
As @jonrsharpe mentioned in his comment, this
print date.date() (ISO output)
print date.date()
or print date.strftime('%d/%m/%Y')
print date.strftime('%d/%m/%Y')
in your input format.
from datetime import date today = date.today() print today.strftime('%d/%m/%Y')