文章詳情頁
python - datetime時間輸出的問題
瀏覽:140日期:2022-07-24 10:37:19
問題描述
1在codecademy上學習PYTHON基礎知識 學到 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()
相關文章:
1. javascript - js setTimeout在雙重for循環中如何使用?2. atom開始輸入!然后按tab只有空格出現沒有html格式出現3. java - 線上應用,如果數據庫操作失敗的話應該如何處理?4. MySQL中的enum類型有什么優點?5. MYSQL 根據兩個字段值查詢 但兩個值的位置可能是互換的,這個怎么查?6. css - 如何選擇字體?7. javascript - 有適合開發手機端Html5網頁小游戲的前端框架嗎?8. javascript - h5微信中怎么禁止橫屏9. mysql - linux連接數據庫報錯10. mysql - 這種分級一對多,且分級不平衡的模型該怎么設計表?
排行榜
