Your browser does not support the Canvas element.

time 模块

一、时间模块

python 中有三种时间:

  时间戳时间:记录的是从1970年1月1日 0:0:0 / 8:0:0(英国是0点,中国是8点)到此时此刻所走的秒数。

  print(time.time())

  结构化时间:print(time.localtime)就会得到一个这种形式的结构化时间

  

  格式化时间:(字符串时间)是一个str 的数据类型

  time.strftime('%Y-%m-%d') 制定一种格式

二、第三种时间的换算

  

 

posted @ 2018-08-08 17:52  一根小菜  阅读(80)  评论(0编辑  收藏  举报
Your browser does not support the Canvas element.