如何仅打印日期而不包括datetime.datetime.strptime()中的时间

gad*_*dss 7 python datetime

我有这个代码:

>>> import datetime
>>> l = '2011-12-02'
>>> t = datetime.datetime.strptime(l, '%Y-%m-%d')
>>> print t
2011-12-02 00:00:00
Run Code Online (Sandbox Code Playgroud)

我的问题是,有可能只会2011-12-02打印出来吗?

Dan*_* D. 12

>>> t.strftime('%Y-%m-%d')
'2011-12-02'
Run Code Online (Sandbox Code Playgroud)