datetime - Python如何取得目前時間
ringa_lee
ringa_lee 2017-06-28 09:25:57
0
1
1172

Python如何取得目前時間,格式如下:

2017-06-23 22:12:35
ringa_lee
ringa_lee

ringa_lee

全部回覆(1)
阿神

參考文章:Python取得當前時間

time模組(low level)

import time
time.strftime("%Y-%m-%d %H:%M:%S")

datetime模組(high level Object-oriented interface to dates and times)

import datetime
datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") 
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!