python3 time库常用方法

time.time() 获取当前时间戳。
time.ctime() 当前时间的字符串形式。
time.localtime() 当前时间的 struct_time 形式。
time.strftime() 用来获得当前时间,可以将时间格式化为字符串。

Python 中时间日期格式化符号(区分大小写):

 

posted @ 2018-12-07 15:40  pretend_smile  阅读(345)  评论(0)    收藏  举报