diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py index 0e6541c721..9a296c3f2d 100644 --- a/django/utils/dateformat.py +++ b/django/utils/dateformat.py @@ -166,8 +166,8 @@ class DateFormat(TimeFormat): def O(self): "Difference to Greenwich time in hours; e.g. '+0200'" - tz = self.timezone.utcoffset(self.data) - return u"%+03d%02d" % (tz.seconds // 3600, (tz.seconds // 60) % 60) + seconds = self.Z() + return u"%+03d%02d" % (seconds // 3600, (seconds // 60) % 60) def r(self): "RFC 822 formatted date; e.g. 'Thu, 21 Dec 2000 16:01:07 +0200'"