converter.py 文件源码

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

项目:snowflake-connector-python 作者: snowflakedb 项目源码 文件源码
def _get_session_tz(self):
        """ Get the session timezone or use the local computer's timezone. """
        try:
            tz = self.get_parameter(u'TIMEZONE')
            if not tz:
                tz = 'UTC'
            return pytz.timezone(tz)
        except pytz.exceptions.UnknownTimeZoneError:
            logger.warning('converting to tzinfo failed')
            if tzlocal is not None:
                return tzlocal.get_localzone()
            else:
                try:
                    return datetime.timezone.utc
                except AttributeError:  # py2k
                    return pytz.timezone('UTC')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号