文章詳情頁
python - datetime時間輸出的問題
瀏覽:178日期: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. mysql - 記得以前在哪里看過一個估算時間的網(wǎng)站2. 希望講講異常處理3. python中merge后文件莫名變得非常大4. css3 - 純css實現(xiàn)點擊特效5. javascript - 關(guān)于<a>元素與<input>元素的JS事件運行問題6. css3 - [CSS] 動畫效果 3D翻轉(zhuǎn)bug7. docker start -a dockername 老是卡住,什么情況?8. java - 為什么第一個線程已經(jīng)釋放了鎖,第二個線程卻不行?9. docker內(nèi)創(chuàng)建jenkins訪問另一個容器下的服務(wù)器問題10. 大家好,我想請問一下怎么做搜索欄能夠搜索到自己網(wǎng)站的內(nèi)容。
排行榜

熱門標(biāo)簽