SpringBoot2.0.0啟動流程
阿新 • • 發佈:2020-12-12
一、time與datetime模組
在Python中,通常有這幾種方式來表示時間:
- 時間戳(timestamp):通常來說,時間戳表示的是從1970年1月1日00:00:00開始按秒計算的偏移量。我們執行“type(time.time())”,返回的是float型別。
- 格式化的時間字串(Format String)
- 結構化的時間(struct_time):struct_time元組共有9個元素共九個元素:(年,月,日,時,分,秒,一年中第幾周,一年中第幾天,夏令時)
import time print(time.time()) #時間戳:1607761067.0330493 print(time.strftime('
View Code