Skip to content

Commit

Permalink
Fix for python-babel#133.
Browse files Browse the repository at this point in the history
  • Loading branch information
benselme committed Jan 8, 2015
1 parent 246996b commit 92b52bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion babel/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ def get_timezone_gmt(datetime=None, width='long', locale=LC_TIME):
datetime = datetime.replace(tzinfo=UTC)
locale = Locale.parse(locale)

offset = datetime.tzinfo.utcoffset(datetime)
# fix for mitsuhiko/babel#133 : Any time will do since we just want the
# offset
offset = datetime.tzinfo.utcoffset(datetime_.utcnow())
seconds = offset.days * 24 * 60 * 60 + offset.seconds
hours, seconds = divmod(seconds, 3600)
if width == 'short':
Expand Down

0 comments on commit 92b52bd

Please sign in to comment.