Dondon's Python and Django Note
(移至...)
首頁
▼
2017年7月4日 星期二
Python - How to get and format current time in python - 取得現在時間並依需求格式化
Python版本:Python 3.6.0 :: Anaconda 4.3.1 (64-bit)
系統版本:Windows 10
from datetime import datetime datetime.now().strftime("%Y-%m-%d %H:%M:%S")
執行結果:
'2017-07-04 11:20:00'
沒有留言:
張貼留言
‹
›
首頁
查看網路版
沒有留言:
張貼留言