Package pyxb :: Package utils :: Module utility :: Class UTCOffsetTimeZone
[hide private]
[frames] | no frames]

Class UTCOffsetTimeZone

source code

     object --+    
              |    
datetime.tzinfo --+
                  |
                 UTCOffsetTimeZone

A datetime.tzinfo subclass that helps deal with UTC conversions in an ISO8601 world.

This class only supports fixed offsets from UTC.

Instance Methods [hide private]
 
__init__(self, spec=None, flip=False)
Create a time zone instance with a fixed offset from UTC.
source code
 
utcoffset(self, dt)
Returns the constant offset for this zone.
source code
 
tzname(self, dt)
Return the name of the timezone in ISO8601 format.
source code
 
dst(self, dt)
Returns a constant zero duration.
source code

Inherited from datetime.tzinfo: __getattribute__, __new__, __reduce__, fromutc

Inherited from object: __delattr__, __format__, __hash__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __Lexical_re = re.compile(r'^([-\+])(\d\d):(\d\d)$')
  __utcOffset_min = 0
  __utcOffset_td = None
hash(x)
  __ZeroDuration = datetime.timedelta(0)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, spec=None, flip=False)
(Constructor)

source code 

Create a time zone instance with a fixed offset from UTC.

Parameters:
  • spec - Specifies the offset. Can be an integer counting minutes east of UTC, the value None (equal to 0 minutes east), or a string that conform to the ISO8601 time zone sequence (Z, or [+-]HH:MM).
  • flip - If False (default), no adaptation is done. If True, the time zone offset is negated, resulting in the conversion from localtime to UTC rather than the default of UTC to localtime.
Overrides: object.__init__

utcoffset(self, dt)

source code 

Returns the constant offset for this zone.

Overrides: datetime.tzinfo.utcoffset

tzname(self, dt)

source code 

Return the name of the timezone in ISO8601 format.

Overrides: datetime.tzinfo.tzname

dst(self, dt)

source code 

Returns a constant zero duration.

Overrides: datetime.tzinfo.dst