我们从Python开源项目中,提取了以下21个代码示例,用于说明如何使用datetime.tzinfo.__init__()。
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
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)
def __init__(self, timezone): self.timezone = timezone
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)
def __init__(self, dt): tzinfo.__init__(self) self._tzname = self.tzname(dt)
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)
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)