diff options
Diffstat (limited to 'src/isodate/tzinfo.py')
-rw-r--r-- | src/isodate/tzinfo.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/isodate/tzinfo.py b/src/isodate/tzinfo.py index ed6720f..820c88d 100644 --- a/src/isodate/tzinfo.py +++ b/src/isodate/tzinfo.py @@ -1,5 +1,5 @@ ''' -This module provides some datetime.tzinfo implementations. +This module provides some datetime.tzinfo implementations. All those classes are taken from the Python documentation. ''' @@ -7,14 +7,14 @@ from datetime import timedelta, tzinfo import time ZERO = timedelta(0) -# constant for zero time offset. +# constant for zero time offset. class Utc(tzinfo): '''UTC - + Universal time coordinated time zone. ''' - + def utcoffset(self, dt): ''' Return offset from UTC in minutes east of UTC, which is ZERO for UTC. @@ -39,16 +39,16 @@ UTC = Utc() class FixedOffset(tzinfo): ''' A class building tzinfo objects for fixed-offset time zones. - - Note that FixedOffset(0, "UTC") is a different way to build a - UTC tzinfo object. + + Note that FixedOffset(0, 0, "UTC") or FixedOffset() is a different way to + build a UTC tzinfo object. ''' - - def __init__(self, offset_hours, offset_minutes, name): + + def __init__(self, offset_hours=0, offset_minutes=0, name="UTC"): ''' Initialise an instance with time offset and name. The time offset should be positive for time zones east of UTC - and negate for time zones west of UTC. + and negate for time zones west of UTC. ''' self.__offset = timedelta(hours=offset_hours, minutes=offset_minutes) self.__name = name @@ -68,11 +68,11 @@ class FixedOffset(tzinfo): def dst(self, dt): ''' - Return the daylight saving time (DST) adjustment, in minutes east of + Return the daylight saving time (DST) adjustment, in minutes east of UTC. ''' return ZERO - + def __repr__(self): ''' Return nicely formatted repr string. |