python的时间模块似乎有点杂乱无章.例如,以下是docstring中的方法列表:
time() -- return current time in seconds since the Epoch as a float
clock() -- return CPU time since process start as a float
sleep() -- delay for a number of seconds given as a float
gmtime() -- convert seconds since Epoch to UTC tuple
localtime() -- convert seconds since Epoch to local time tuple
asctime() -- convert time tuple to string
ctime() -- convert time in seconds to string
mktime() -- convert local time tuple to seconds since Epoch
strftime() -- convert time tuple to string according to format specification
strptime() -- parse string to time tuple according to format specification
tzset() -- change the local timezone
Run Code Online (Sandbox Code Playgroud)
查看localtime()及其反mktime(),为什么gmtime()没有反转?
奖金问题:你怎么称呼这个方法?你会如何实现它?
| 归档时间: |
|
| 查看次数: |
12176 次 |
| 最近记录: |