文章詳情頁
python - datetime時間輸出的問題
瀏覽:150日期:2022-07-24 10:37:19
問題描述
1在codecademy上學(xué)習(xí)PYTHON基礎(chǔ)知識 學(xué)到 datetime
運行了一下代碼:
from datetime import datetimenow=datetime.now()#print nowprint now.yearprint now.monthprint now.dayprint now.time"輸出的問題是: 年 月 日 都沒問題 就是 時間那里 不知道是啥意思。’’’2017515<built-in method time of datetime.datetime object at 0x7f7bd75f7f30>None
問題解答
回答1:from datetime import datetimenow=datetime.now()#print nowprint now.yearprint now.monthprint now.dayprint now.hourprint now.minuteprint now.secondprint now.microsecond
沒有time屬性
print now.date()print now.time()print now.timetuple()print now.ctime()回答2:
print now.tiem()
相關(guān)文章:
1. node.js - mongoDB使用$gte的問題2. android - 優(yōu)酷的安卓及蘋果app還在使用flash技術(shù)嗎?3. android 微信是如何實現(xiàn)即時更新好友頭像的4. 黑客 - Python模塊安全權(quán)限5. android - 像支付寶到位這種點擊marker點擊變大怎么做的6. html5 - H5頁面喚起APP導(dǎo)航7. docker - 如何修改運行中容器的配置8. angular.js - ngview配置路由失敗9. javascript - 關(guān)于vuejs讀取數(shù)據(jù)的問題10. javascript - 可以左右滑動的導(dǎo)航菜單怎么實現(xiàn)
排行榜

熱門標(biāo)簽