Python datetime.tzinfo 模块,__init__() 实例源码

我们从Python开源项目中,提取了以下21个代码示例,用于说明如何使用datetime.tzinfo.__init__()

项目:CodingDojo    作者:ComputerSocietyUNB    | 项目源码 | 文件源码
def __init__(self, offset=None, name=None):
        if offset is not None:
            self.__offset = timedelta(minutes=offset)
        if name is not None:
            self.__name = name
项目:CodingDojo    作者:ComputerSocietyUNB    | 项目源码 | 文件源码
def __init__(self):
        self.STDOFFSET = timedelta(seconds=-_time.timezone)
        if _time.daylight:
            self.DSTOFFSET = timedelta(seconds=-_time.altzone)
        else:
            self.DSTOFFSET = self.STDOFFSET
        self.DSTDIFF = self.DSTOFFSET - self.STDOFFSET
        tzinfo.__init__(self)
项目:CodingDojo    作者:ComputerSocietyUNB    | 项目源码 | 文件源码
def __init__(self, timezone):
        self.timezone = timezone
项目:lifesoundtrack    作者:MTG    | 项目源码 | 文件源码
def __init__(self, offset=None, name=None):
        if offset is not None:
            self.__offset = timedelta(minutes=offset)
        if name is not None:
            self.__name = name
项目:lifesoundtrack    作者:MTG    | 项目源码 | 文件源码
def __init__(self):
        self.STDOFFSET = timedelta(seconds=-_time.timezone)
        if _time.daylight:
            self.DSTOFFSET = timedelta(seconds=-_time.altzone)
        else:
            self.DSTOFFSET = self.STDOFFSET
        self.DSTDIFF = self.DSTOFFSET - self.STDOFFSET
        tzinfo.__init__(self)
项目:lifesoundtrack    作者:MTG    | 项目源码 | 文件源码
def __init__(self, timezone):
        self.timezone = timezone
项目:aiorestframework    作者:Skorpyon    | 项目源码 | 文件源码
def __init__(self, offset=None, name=None):
        if offset is not None:
            self.__offset = timedelta(minutes=offset)
        if name is not None:
            self.__name = name
项目:aiorestframework    作者:Skorpyon    | 项目源码 | 文件源码
def __init__(self):
        self.STDOFFSET = timedelta(seconds=-_time.timezone)
        if _time.daylight:
            self.DSTOFFSET = timedelta(seconds=-_time.altzone)
        else:
            self.DSTOFFSET = self.STDOFFSET
        self.DSTDIFF = self.DSTOFFSET - self.STDOFFSET
        tzinfo.__init__(self)
项目:djanoDoc    作者:JustinChavez    | 项目源码 | 文件源码
def __init__(self, offset=None, name=None):
        if offset is not None:
            self.__offset = timedelta(minutes=offset)
        if name is not None:
            self.__name = name
项目:djanoDoc    作者:JustinChavez    | 项目源码 | 文件源码
def __init__(self):
        self.STDOFFSET = timedelta(seconds=-_time.timezone)
        if _time.daylight:
            self.DSTOFFSET = timedelta(seconds=-_time.altzone)
        else:
            self.DSTOFFSET = self.STDOFFSET
        self.DSTDIFF = self.DSTOFFSET - self.STDOFFSET
        tzinfo.__init__(self)
项目:djanoDoc    作者:JustinChavez    | 项目源码 | 文件源码
def __init__(self, timezone):
        self.timezone = timezone
项目:Deploy_XXNET_Server    作者:jzp820927    | 项目源码 | 文件源码
def __init__(self, offset):
        if isinstance(offset, timedelta):
            self.__offset = offset
            offset = self.__offset.seconds // 60
        else:
            self.__offset = timedelta(minutes=offset)

        sign = offset < 0 and '-' or '+'
        self.__name = u"%s%02d%02d" % (sign, abs(offset) / 60., abs(offset) % 60)
项目:Deploy_XXNET_Server    作者:jzp820927    | 项目源码 | 文件源码
def __init__(self, dt):
        tzinfo.__init__(self)
        self._tzname = self.tzname(dt)
项目:django-next-train    作者:bitpixdigital    | 项目源码 | 文件源码
def __init__(self, offset=None, name=None):
        if offset is not None:
            self.__offset = timedelta(minutes=offset)
        if name is not None:
            self.__name = name
项目:django-next-train    作者:bitpixdigital    | 项目源码 | 文件源码
def __init__(self):
        self.STDOFFSET = timedelta(seconds=-_time.timezone)
        if _time.daylight:
            self.DSTOFFSET = timedelta(seconds=-_time.altzone)
        else:
            self.DSTOFFSET = self.STDOFFSET
        self.DSTDIFF = self.DSTOFFSET - self.STDOFFSET
        tzinfo.__init__(self)
项目:django-next-train    作者:bitpixdigital    | 项目源码 | 文件源码
def __init__(self, timezone):
        self.timezone = timezone
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def __init__(self, offset):
        warnings.warn(
            "django.utils.tzinfo.FixedOffset will be removed in Django 1.9. "
            "Use django.utils.timezone.get_fixed_timezone instead.",
            RemovedInDjango19Warning)
        if isinstance(offset, timedelta):
            self.__offset = offset
            offset = self.__offset.seconds // 60
        else:
            self.__offset = timedelta(minutes=offset)

        sign = '-' if offset < 0 else '+'
        self.__name = "%s%02d%02d" % (sign, abs(offset) / 60., abs(offset) % 60)
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def __init__(self, dt):
        warnings.warn(
            "django.utils.tzinfo.LocalTimezone will be removed in Django 1.9. "
            "Use django.utils.timezone.get_default_timezone instead.",
            RemovedInDjango19Warning)
        tzinfo.__init__(self)
        self.__dt = dt
        self._tzname = self.tzname(dt)
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def __init__(self, offset=None, name=None):
        if offset is not None:
            self.__offset = timedelta(minutes=offset)
        if name is not None:
            self.__name = name
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def __init__(self):
        self.STDOFFSET = timedelta(seconds=-_time.timezone)
        if _time.daylight:
            self.DSTOFFSET = timedelta(seconds=-_time.altzone)
        else:
            self.DSTOFFSET = self.STDOFFSET
        self.DSTDIFF = self.DSTOFFSET - self.STDOFFSET
        tzinfo.__init__(self)
项目:django-wechat-api    作者:crazy-canux    | 项目源码 | 文件源码
def __init__(self, timezone):
        self.timezone = timezone