Django

Code

Changeset 347

Show
Ignore:
Timestamp:
07/29/05 16:40:09 (3 years ago)
Author:
adrian
Message:

Fixed #228 -- Better handling of timezones. Thanks, rmunn

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/db/typecasts.py

    r346 r347  
    2222    if not s: return None 
    2323    d, t = s.split() 
    24     if t[-3] in ('-', '+'): 
    25         t = t[:-3] # Remove the time-zone information, if it exists. 
     24    # Extract timezone information, if it exists. Currently we just throw 
     25    # it away, but in the future we may make use of it. 
     26    if '-' in t: 
     27        t, tz = t.split('-', 1) 
     28        tz = '-' + tz 
     29    elif '+' in t: 
     30        t, tz = t.split('+', 1) 
     31        tz = '+' + tz 
     32    else: 
     33        tz = '' 
    2634    dates = d.split('-') 
    2735    times = t.split(':')