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
我的问题是,有可能只会2011-12-02打印出来吗?
2011-12-02
Dan*_* D. 12
>>> t.strftime('%Y-%m-%d') '2011-12-02'
Ble*_*der 5
与strftime():
strftime()
print t.strftime('%Y-%m-%d')
归档时间:
14 年,1 月 前
查看次数:
17022 次
最近记录: