status.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:PyTradier 作者: rleonard21 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号