文章詳情頁
datetime - Python如何獲取當(dāng)前時(shí)間
瀏覽:286日期:2022-06-27 10:55:33
問題描述
Python如何獲取當(dāng)前時(shí)間,格式如下:
2017-06-23 22:12:35
問題解答
回答1:參考文章:Python獲取當(dāng)前時(shí)間
time模塊(low level)import timetime.strftime('%Y-%m-%d %H:%M:%S')datetime模塊(high level Object-oriented interface to dates and times)
import datetimedatetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
相關(guān)文章:
1. javascript - sublime快鍵鍵問題2. javascript - immutable配合react提升性能?3. Apache 已經(jīng)把網(wǎng)站根目錄的改為allow from all了,但是服務(wù)器還是不能訪問?4. javascript - nodejs關(guān)于進(jìn)程間發(fā)送句柄的一點(diǎn)疑問5. css - 寫頁面遇到個(gè)布局問題,求大佬們幫解答,在線等,急!~6. 實(shí)現(xiàn)bing搜索工具urlAPI提交7. javascript - 移動端上不能實(shí)現(xiàn)拖拽布局嗎?8. vue.js - Vue 如何像Angular.js watch 一樣監(jiān)聽數(shù)據(jù)變化9. 配置Apache時(shí),添加對PHP的支持時(shí)語法錯誤10. phpstudy8.1支持win11系統(tǒng)嗎?
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備