【发布时间】:2010-09-12 21:43:05
【问题描述】:
python 的时间模块似乎有点随意。例如,这里有一个方法列表,来自文档字符串:
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
看看localtime()和它的逆mktime(),为什么gmtime()没有逆?
额外问题:您将方法命名为什么?你将如何实现它?
【问题讨论】:
标签: python