dateformat.py 文件源码

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

项目:CodingDojo 作者: ComputerSocietyUNB 项目源码 文件源码
def T(self):
        """
        Time zone of this machine; e.g. 'EST' or 'MDT'.

        If timezone information is not available, this method returns
        an empty string.
        """
        if not self.timezone:
            return ""

        name = None
        try:
            name = self.timezone.tzname(self.data)
        except Exception:
            # pytz raises AmbiguousTimeError during the autumn DST change.
            # This happens mainly when __init__ receives a naive datetime
            # and sets self.timezone = get_default_timezone().
            pass
        if name is None:
            name = self.format('O')
        return six.text_type(name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号