def timestamp(self, **config): # returns the timestamp of the last check
""" Returns the timestamp of the status update.
The default style is Unix Epoch time, though using ``style='pretty'`` returns the time in ``YYYY-MM-DD H:M:S``
"""
response = self._parse_response('timestamp', **config)
if 'style' in config.keys():
# user has specified style of time response
if config['style'] is 'epoch':
return response # API returns Unix epoch by default, so return raw response time value
if config['style'] is 'pretty': # useful for displaying the timestamp
return time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime(response))
else:
return response
评论列表
文章目录