Ticket #5470: utils_dateformat_py.patch

File utils_dateformat_py.patch, 749 bytes (added by Paul Lanier <planier@…>, 17 years ago)

Patch for dateformat.py

  • django/utils/dateformat.py

     
    251251        """Time zone offset in seconds (i.e. '-43200' to '43200'). The offset
    252252        for timezones west of UTC is always negative, and for those east of UTC
    253253        is always positive."""
    254         return self.timezone.utcoffset(self.data).seconds
     254        offset = self.timezone.utcoffset(self.data)
     255        # Only days can be negative so negative offsets have days=-1 and
     256        # seconds positive.
     257        return offset.days * 24 * 60 * 60 + offset.seconds
    255258
    256259def format(value, format_string):
    257260    "Convenience function"
Back to Top