Go to the latest version of this document.

# ``twisted`.`python`.`_tzhelper`.`FixedOffsetTimeZone``

class documentation

`class FixedOffsetTimeZone(TZInfo): (source)`

Constructors: `FixedOffsetTimeZone.fromLocalTimeStamp(timeStamp)`, `FixedOffsetTimeZone.fromSignHoursMinutes(sign, hours, minutes)`, `FixedOffsetTimeZone(offset, name)`

View In Hierarchy

Represents a fixed timezone offset (without daylight saving time).

Class Method | `fromLocalTimeStamp` | Create a time zone with a fixed offset corresponding to a time stamp in the system's locally configured time zone.
Class Method | `fromSignHoursMinutes` | Construct a `FixedOffsetTimeZone` from an offset described by sign ('+' or '-'), hours, and minutes.
Method | `__init__` | Construct a `FixedOffsetTimeZone` with a fixed offset.
Method | `dst` | Return a zero `TimeDelta` for the daylight saving time offset, since there is never one.
Method | `tzname` | Return a string describing this timezone.
Method | `utcoffset` | Return the given timezone's offset from UTC.
Instance Variable | `name` | A `str` giving the name of this timezone; the name just includes how much time this offset represents.
Instance Variable | `offset` | A `TimeDelta` giving the amount of time this timezone is offset.

@classmethod
def fromLocalTimeStamp(cls, timeStamp: `float`) -> `FixedOffsetTimeZone`: (source)

Create a time zone with a fixed offset corresponding to a time stamp in the system's locally configured time zone.

@classmethod
def fromSignHoursMinutes(cls, sign: `str`, hours: `int`, minutes: `int`) -> `FixedOffsetTimeZone`: (source)

Construct a `FixedOffsetTimeZone` from an offset described by sign ('+' or '-'), hours, and minutes.

Parameters
sign:`str` | A string describing the positive or negative-ness of the offset.
hours:`int` | The number of hours in the offset.
minutes:`int` | The number of minutes in the offset

Returns
`FixedOffsetTimeZone` | A time zone with the given offset, and a name describing the offset.

Note
For protocol compatibility with AMP, this method never uses 'Z'

def __init__(self, offset: `TimeDelta`, name: `str | None` = None): (source)

Construct a `FixedOffsetTimeZone` with a fixed offset.

Parameters
offset:`TimeDelta` | a delta representing the offset from UTC.
name:`str | None` | A name to be given for this timezone.

def dst(self, dt: `DateTime | None`) -> `TimeDelta`: (source)

Return a zero `TimeDelta` for the daylight saving time offset, since there is never one.

def tzname(self, dt: `DateTime | None`) -> `str`: (source)

Return a string describing this timezone.

def utcoffset(self, dt: `DateTime | None`) -> `TimeDelta`: (source)

Return the given timezone's offset from UTC.

name = (source)

A `str` giving the name of this timezone; the name just includes how much time this offset represents.

offset = (source)

A `TimeDelta` giving the amount of time this timezone is offset.