fbpx
Python初學程式

Python 常用時間數據類型擴充站

前言 此篇文章將會簡單補充 Python 中時間模組的應用,希望能用最短的時間讓新手們 pick up Python 的時間相關模組~ 大綱 時間模組:處理時間格式化需求。 日曆模組: datetime模組:獲取當前時間使用。 一. 時間模組 Python中導入時間模組,語法如下: 範例運作:https://repl.it/@dreamline2/time-module#main.py 獲取當前時間戳 https://gist.github.com/Celia-code/a2f32929b5e63be580b1e19eb244b736 2. 獲取時間元組:獲取當前時間並以元組方式呈現 https://gist.github.com/Celia-code/bb82846b356756e440861fdfcc6f0fb7 3. 獲取格式化時間:時間戳變成格式化時間:time.ctime( ) https://gist.github.com/Celia-code/9a2e1938bc050ba6a65045e39e6a0961…
celia
May 15, 2020