Skip to content

Commit

Permalink
Merge pull request #377 from mrmrwat/master
Browse files Browse the repository at this point in the history
Fix negative offset for UTC. Thanks @mrmrwat
  • Loading branch information
andrewelkins committed Nov 29, 2016
2 parents 0254463 + a6c9108 commit 91365c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arrow/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _format_token(self, dt, token):
tz = dateutil_tz.tzutc() if dt.tzinfo is None else dt.tzinfo
total_minutes = int(util.total_seconds(tz.utcoffset(dt)) / 60)

sign = '+' if total_minutes > 0 else '-'
sign = '+' if total_minutes >= 0 else '-'
total_minutes = abs(total_minutes)
hour, minute = divmod(total_minutes, 60)

Expand Down
2 changes: 1 addition & 1 deletion tests/arrow_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_bare_format(self):

result = self.arrow.format()

assertEqual(result, '2013-02-03 12:30:45-00:00')
assertEqual(result, '2013-02-03 12:30:45+00:00')

def test_format_no_format_string(self):

Expand Down

0 comments on commit 91365c1

Please sign in to comment.