文章詳情頁
python - datetime時間輸出的問題
瀏覽:187日期: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. angular.js - SpringMVC+Angular如何設計路由,從多個頁面不止index.html作為入口2. angular.js - angular中的controller 的js文件如何修改css樣式比如margin:0?3. angular.js - angularjs ng-bind-html如何插入整段HTML4. Android百度地圖怎樣獲取圓的外切矩形5. node.js - vue-cli構建報錯。。。生成不了模板,求解~!!6. javascript - 百度echarts圖表如何修改7. javascript - 移動端css動畫播放狀態暫停在ios不起作用 animation-play-state8. javascript - 微信小程序在wx:for循環里判斷數據再給類名,條件為動態時無效9. angular.js使用$resource服務把數據存入mongodb的問題。10. 關于docker下的nginx壓力測試
排行榜
