文章詳情頁
python - datetime時間輸出的問題
瀏覽:257日期: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"輸出的問題是: 年 月 日 都沒問題 就是 時間那里 不知道是啥意思?!?017515<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. angular.js - angular內容過長展開收起效果2. dockerfile - [docker build image失敗- npm install]3. docker-compose中volumes的問題5. golang - 用IDE看docker源碼時的小問題6. Docker for Mac 創建的dnsmasq容器連不上/不工作的問題7. mac里的docker如何命令行開啟呢?8. 我在centos容器里安裝docker,也就是在容器里安裝容器,報錯了?9. docker內創建jenkins訪問另一個容器下的服務器問題10. nignx - docker內nginx 80端口被占用
排行榜

網公網安備