Fix in tzoffset and _get_fixed_offset_tz

The tzoffset object is constructed with offset in minutes not in
seconds.
This commit is contained in:
Klaudiusz Staniek 2013-05-09 20:59:00 +02:00
parent 60cfab995f
commit 3279697128

View file

@ -108,7 +108,7 @@ except:
def __init__(self, name, offset): def __init__(self, name, offset):
self._name = name self._name = name
self._offset = datetime.timedelta(seconds=offset) self._offset = datetime.timedelta(minutes=offset)
def utcoffset(self, dt): def utcoffset(self, dt):
return self._offset return self._offset
@ -154,7 +154,7 @@ except:
absoff = offsetmins absoff = offsetmins
name = "UTC%s%02d:%02d" % (sign, int(absoff / 60), absoff % 60) name = "UTC%s%02d:%02d" % (sign, int(absoff / 60), absoff % 60)
inst = tzoffset(offsetmins, name) inst = tzoffset(name,offsetmins)
_fixed_offset_tzs[offsetmins] = inst _fixed_offset_tzs[offsetmins] = inst
return _fixed_offset_tzs[offsetmins] return _fixed_offset_tzs[offsetmins]