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')
converter.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录