Checkthis's Notes
2017年11月13日 星期一
Python - DataTime筆記
from datetime import date
取得日期
t = date.today()
轉換字串
t.strftime('%Y%m%d') # 20171114
轉成TUPLE
tt = t.timetuple()
使用localtime()取得時間跟日期
import time
time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言