Package pology :: Module header :: Class TZInfo

Class TZInfo

     object --+    
              |    
datetime.tzinfo --+
                  |
                 TZInfo

A simple derived time zone info for use in datetime objects.

Instance Methods
 
__init__(self, hours=None, minutes=None)
Create a time zone with given offset in hours and minutes.
 
utcoffset(self, dt)
datetime -> minutes east of UTC (negative for west of UTC).
 
dst(self, dt)
datetime -> DST offset in minutes east of UTC.
 
tzname(self, dt)
datetime -> string name of time zone.

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

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

Properties

Inherited from object: __class__

Method Details

__init__(self, hours=None, minutes=None)
(Constructor)

 

Create a time zone with given offset in hours and minutes.

The offset given by minutes is added to that given by hours, e.g. hours=2 and minutes=30 means two and a half hours offset. If minutes is given but hours is not, hours is considered zero. If neither hours nor minutes are given, the offset is read from system time zone.

Parameters:
  • hours (int) - the time zone offset in hours
  • minutes (int) - additional offset in minutes
Overrides: object.__init__

utcoffset(self, dt)

 

datetime -> minutes east of UTC (negative for west of UTC).

Overrides: datetime.tzinfo.utcoffset
(inherited documentation)

dst(self, dt)

 

datetime -> DST offset in minutes east of UTC.

Overrides: datetime.tzinfo.dst
(inherited documentation)

tzname(self, dt)

 

datetime -> string name of time zone.

Overrides: datetime.tzinfo.tzname
(inherited documentation)