diff options
| author | Menno Smits <menno@freshfoo.com> | 2012-01-17 15:51:32 +0000 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2012-01-30 13:27:01 +0000 |
| commit | 1469a56512a9776eb87629be7894b3bf2be89183 (patch) | |
| tree | e3810135c925a1b51baf0218d5b9a8531d44b9eb /lib/tz.py | |
| parent | 35ff2def347aba23e89f464a7610275f1e2e4c57 (diff) | |
| download | psycopg2-1469a56512a9776eb87629be7894b3bf2be89183.tar.gz | |
Fixed repr for FixedOffsetTimezone for offsets west of UTC (negative)
The offset displayed was always positive and somewhat confusing. The
offset displayed now is the offset that the instance was created
with.
Also added some tests for initialisation.
Diffstat (limited to 'lib/tz.py')
| -rw-r--r-- | lib/tz.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -50,8 +50,9 @@ class FixedOffsetTimezone(datetime.tzinfo): self._name = name def __repr__(self): + offset_mins = self._offset.seconds // 60 + self._offset.days * 24 * 60 return "psycopg2.tz.FixedOffsetTimezone(offset=%r, name=%r)" \ - % (self._offset.seconds // 60, self._name) + % (offset_mins, self._name) def utcoffset(self, dt): return self._offset |
