Django

Code

Changeset 6275

Show
Ignore:
Timestamp:
09/15/07 05:36:14 (1 year ago)
Author:
mtredinnick
Message:

Fixed #5470 -- Fixed the 'Z' time format marker in templates to handle timezones west of UTC. Thanks, Paul Lanier.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r6274 r6275  
    183183    Nick Lane <nick.lane.au@gmail.com> 
    184184    Stuart Langridge <http://www.kryogenix.org/> 
     185    Paul Lanier <planier@google.com> 
    185186    Nicola Larosa <nico@teknico.net> 
    186187    Eugene Lazutkin <http://lazutkin.com/blog/> 
  • django/trunk/django/utils/dateformat.py

    r5671 r6275  
    249249 
    250250    def Z(self): 
    251         """Time zone offset in seconds (i.e. '-43200' to '43200'). The offset 
    252         for timezones west of UTC is always negative, and for those east of UTC 
    253         is always positive.""" 
    254         return self.timezone.utcoffset(self.data).seconds 
     251        """ 
     252        Time zone offset in seconds (i.e. '-43200' to '43200'). The offset for 
     253        timezones west of UTC is always negative, and for those east of UTC is 
     254        always positive. 
     255        """ 
     256        offset = self.timezone.utcoffset(self.data) 
     257        # Only days can be negative, so negative offsets have days=-1 and 
     258        # seconds positive. Positive offsets have days=0 
     259        return offset.days * 86400 + offset.seconds 
    255260 
    256261def format(value, format_string):