i18n.py 文件源码

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

项目:blockhooks 作者: EthereumWebhooks 项目源码 文件源码
def to_local_timezone(self, datetime):
        """Returns a datetime object converted to the local timezone.

        :param datetime:
            A ``datetime`` object.
        :returns:
            A ``datetime`` object normalized to a timezone.
        """
        if datetime.tzinfo is None:
            datetime = datetime.replace(tzinfo=pytz.UTC)

        return self.tzinfo.normalize(datetime.astimezone(self.tzinfo))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号