def __init__(self, offset_string): ############################################################################# tzinfo.__init__(self) minus, hh, mm = re.match(r'^([-+]?)(\d\d)(\d\d)$', offset_string).groups() sign = minus and -1 or 1 self._offset = timedelta(minutes = sign*(60*int(hh) + int(mm))) self._offset_string = offset_string
def __init__(self, *a, **kw): _tzinfo.__init__(self, *a, **kw) self.__dstoffset = self.__stdoffset = _timedelta( seconds=-_time.timezone) if _time.daylight: self.__dstoffset = _timedelta(seconds=-_time.altzone) self.__dstdiff = self.__dstoffset - self.__stdoffset
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)
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.", PendingDeprecationWarning) tzinfo.__init__(self) self.__dt = dt self._tzname = self.tzname(dt)
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): # This code is moved in __init__ to execute it as late as possible # See get_default_timezone(). 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, hours, minutes): ''' Create a new FixedOffset instance with the given offset. ''' tzinfo.__init__(self) if minutes < 0: raise ValueError("minutes must not be negative") if hours < 0: minutes *= -1 self.__offset = timedelta(hours=hours, minutes=minutes) self.__name = "UTC" + timezone(timedelta_seconds(self.__offset))
def __init__(self, name, utcoffset=timedelta(), dst=timedelta()): """ Initialize a time zone. :param name: Display name. :type name: str :param utcoffset: Offset from the universal time. Can be a timedelta or an int (number of hours). Pass ``None`` to use the resulting tz to mark 'naive' time or datetime objects. :type utcoffset: timedelta|int|null :param dst: Time offset to account for DST. This must be already included in ``utcoffset``. In this test implementation it is constant and does not depend on the date. Can be a timedelta or an int (number of hours). :type dst: timedelta|int """ tzinfo.__init__(self) self._name = name self._utcoffset = to_delta(utcoffset) self._dst = to_delta(dst)
def __init__(self): # TODO: Check how affect! Looks like no effect! # This code is moved in __init__ to execute it as late as possible # See get_default_timezone(). octolog.info("<=Utils Time=> __init__ _time.timezone %s", _time.timezone) octolog.info("<=Utils Time=> __init__ _time.daylight %s", _time.daylight) octolog.info("<=Utils Time=> __init__ _time.altzone %s", _time.altzone) # Timezone for SERVER TIME!!!!!!!! # But maybe we should track alt time for Celery settings timezone? self.STDOFFSET = timedelta(seconds=-_time.timezone) octolog.info("<=Utils Time=> __init__ self.STDOFFSET Standard %s", self.STDOFFSET) if _time.daylight: self.DSTOFFSET = timedelta(seconds=-_time.altzone) # self.DSTOFFSET = timedelta(hours=2) octolog.info( "<=Utils Time=> __init__ self.DSTOFFSET Day light save %s", self.DSTOFFSET) else: self.DSTOFFSET = self.STDOFFSET # self.DSTOFFSET = timedelta(hours=0) octolog.info( "<=Utils Time=> __init__ self.DSTOFFSET No Day light save %s", self.DSTOFFSET) self.DSTDIFF = self.DSTOFFSET - self.STDOFFSET octolog.info("<=Utils Time=> __init__ self.DSTDIFF Difference %s", self.DSTDIFF) tzinfo.__init__(self)
def __init__(self, dt): tzinfo.__init__(self, dt) self._tzname = time.tzname[self._isdst(dt)]
def __init__(self): tzinfo.__init__(self)
def __init__(self, dt): tzinfo.__init__(self) self._tzname = self.tzname(dt)
def __init__(self, offset=0): tzinfo.__init__(self) self.offset = offset
"""
def __init__(self): tzinfo.__init__(self) self.stdoffset = timedelta(hours=0) self.reprname = 'England' self.stdname = 'WET' # Western Europe Time self.dstname = 'BST' # British Summer Time
def __init__(self, *a, **kw): _tzinfo.__init__(self, *a, **kw) self.__dstoffset = self.__stdoffset = _timedelta(seconds=-_time.timezone) if _time.daylight: self.__dstoffset = _timedelta(seconds=-_time.altzone) self.__dstdiff = self.__dstoffset - self.__stdoffset
def __init__(self): tzinfo.__init__(self) self.stdoffset = timedelta(hours=0) self.reprname = "England" self.stdname = "WET" # Western Europe Time self.dstname = "BST" # British Summer Time
def __init__(self, dt): tzinfo.__init__(self) self.__dt = dt self._tzname = self.tzname(dt)
def __init__(self, offset, label): tzinfo.__init__(self) self._offset = offset self._label = label