I have following code:
import datetime
x = '2015-01-01'
date = datetime.datetime.strptime(x, "%Y-%m-%d")
print(date)
The problem is that I want to print date like "2015-01-01"
and not "2015-01-01 00:00:00"
. How to print it without hours, minutes and seconds?