Index: django/conf/__init__.py
===================================================================
--- django/conf/__init__.py	(revision 3486)
+++ django/conf/__init__.py	(working copy)
@@ -7,6 +7,7 @@
 """
 
 import os
+import time
 from django.conf import global_settings
 
 ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
@@ -107,6 +108,7 @@
 
         # move the time zone info into os.environ
         os.environ['TZ'] = self.TIME_ZONE
+        time.tzset()
 
     def get_all_members(self):
         return dir(self)
Index: django/db/models/fields/__init__.py
===================================================================
--- django/db/models/fields/__init__.py	(revision 3486)
+++ django/db/models/fields/__init__.py	(working copy)
@@ -7,6 +7,7 @@
 from django.utils.functional import curry
 from django.utils.text import capfirst
 from django.utils.translation import gettext, gettext_lazy
+from django.utils import tzinfo
 import datetime, os, time
 
 class NOT_PROVIDED:
@@ -414,8 +415,6 @@
     def get_db_prep_lookup(self, lookup_type, value):
         if lookup_type == 'range':
             value = [str(v) for v in value]
-        elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte') and hasattr(value, 'strftime'):
-            value = value.strftime('%Y-%m-%d')
         else:
             value = str(value)
         return Field.get_db_prep_lookup(self, lookup_type, value)
@@ -423,7 +422,8 @@
     def pre_save(self, model_instance, add):
         if self.auto_now or (self.auto_now_add and add):
             value = datetime.datetime.now()
-            setattr(model_instance, self.attname, value)
+            tz = tzinfo.LocalTimezone(value)
+            setattr(model_instance, self.attname, value.replace(tzinfo=tz))
             return value
         else:
             return super(DateField, self).pre_save(model_instance, add)
@@ -732,7 +732,8 @@
     def pre_save(self, model_instance, add):
         if self.auto_now or (self.auto_now_add and add):
             value = datetime.datetime.now().time()
-            setattr(model_instance, self.attname, value)
+            tz = tzinfo.LocalTimezone(value)
+            setattr(model_instance, self.attname, value.replace(tzinfo=tz))
             return value
         else:
             return super(TimeField, self).pre_save(model_instance, add)
Index: django/db/backends/util.py
===================================================================
--- django/db/backends/util.py	(revision 3486)
+++ django/db/backends/util.py	(working copy)
@@ -1,5 +1,6 @@
 import datetime
 from time import time
+from django.utils import tzinfo
 
 class CursorDebugWrapper(object):
     def __init__(self, cursor, db):
@@ -52,7 +53,7 @@
         seconds, microseconds = seconds.split('.')
     else:
         microseconds = '0'
-    return datetime.time(int(hour), int(minutes), int(seconds), int(float('.'+microseconds) * 1000000))
+    return datetime.time(int(hour), int(minutes), int(seconds), int(float('.'+microseconds) * 1000000), None)
 
 def typecast_timestamp(s): # does NOT store time zone information
     # "2005-07-29 15:48:00.590358-05"
@@ -64,12 +65,23 @@
     # it away, but in the future we may make use of it.
     if '-' in t:
         t, tz = t.split('-', 1)
-        tz = '-' + tz
+        tz_factor = -1
     elif '+' in t:
         t, tz = t.split('+', 1)
-        tz = '+' + tz
+        tz_factor = 1
     else:
         tz = ''
+    if len(tz) > 0:
+        # compute the offset from UTC in minutes
+        # the parsing is fairly naive and should be improved
+        hours, minutes = tz.split(':', 1)
+        minutes = int(minutes) + 60 * int(hours)
+        if tz_factor < 0:
+            minutes = 1440 - minutes
+        timezone = tzinfo.FixedOffset(minutes)
+    else:
+        timezone = None
+    
     dates = d.split('-')
     times = t.split(':')
     seconds = times[2]
@@ -78,7 +90,7 @@
     else:
         microseconds = '0'
     return datetime.datetime(int(dates[0]), int(dates[1]), int(dates[2]),
-        int(times[0]), int(times[1]), int(seconds), int(float('.'+microseconds) * 1000000))
+        int(times[0]), int(times[1]), int(seconds), int(float('.'+microseconds) * 1000000), timezone)
 
 def typecast_boolean(s):
     if s is None: return None
Index: django/utils/dateformat.py
===================================================================
--- django/utils/dateformat.py	(revision 3486)
+++ django/utils/dateformat.py	(working copy)
@@ -11,12 +11,13 @@
 >>>
 """
 
+from django.conf import settings
 from django.utils.dates import MONTHS, MONTHS_AP, WEEKDAYS
 from django.utils.tzinfo import LocalTimezone
 from calendar import isleap, monthrange
 import re, time
 
-re_formatchars = re.compile(r'(?<!\\)([aABdDfFgGhHiIjlLmMnNOPrsStTUwWyYzZ])')
+re_formatchars = re.compile(r'(?<!\\)([aABcCdDefFgGhHiIjlLmMnNOPrsStTUwWyYzZ])')
 re_escaped = re.compile(r'\\(.)')
 
 class Formatter(object):
@@ -48,6 +49,15 @@
     def B(self):
         "Swatch Internet time"
         raise NotImplementedError
+        
+    def C(self):
+        """ISO 8601 formatted time; e.g. '16:01:07'
+        Proprietary extension."""
+        return self.data.isoformat()
+    
+    def e(self):
+        "Timezone; e.g. 'America/Chicago'"
+        return settings.TIME_ZONE
 
     def f(self):
         """
@@ -88,7 +98,7 @@
         Time, in 12-hour hours, minutes and 'a.m.'/'p.m.', with minutes left off
         if they're zero and the strings 'midnight' and 'noon' if appropriate.
         Examples: '1 a.m.', '1:30 p.m.', 'midnight', 'noon', '12:30 p.m.'
-        Proprietary extension.
+        Proprietary extension. Conflicts with PHP 5.1.3's P format.
         """
         if self.data.minute == 0 and self.data.hour == 0:
             return 'midnight'
@@ -109,6 +119,10 @@
         self.timezone = getattr(dt, 'tzinfo', None)
         if hasattr(self.data, 'hour') and not self.timezone:
             self.timezone = LocalTimezone(dt)
+    
+    def c(self):
+        "ISO 8601 formatted date; e.g. '2000-12-21T16:01:07+02:00'"
+        return self.data.isoformat()
 
     def d(self):
         "Day of the month, 2 digits with leading zeros; i.e. '01' to '31'"
@@ -158,7 +172,7 @@
         return MONTHS_AP[self.data.month]
 
     def O(self):
-        "Difference to Greenwich time in hours; e.g. '+0200'"
+        "Difference to UTC in hours; e.g. '+0200'"
         tz = self.timezone.utcoffset(self.data)
         return "%+03d%02d" % (tz.seconds // 3600, (tz.seconds // 60) % 60)
 
