Ticket #2315: windows_timezone_fix.2.patch
File windows_timezone_fix.2.patch, 2.2 KB (added by , 18 years ago) |
---|
-
django/conf/__init__.py
7 7 """ 8 8 9 9 import os 10 import time 10 11 from django.conf import global_settings 11 12 12 13 ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE" … … 105 106 new_installed_apps.append(app) 106 107 self.INSTALLED_APPS = new_installed_apps 107 108 108 # move the time zone info into os.environ 109 os.environ['TZ'] = self.TIME_ZONE 109 # If time doesn't have tzset (Windows environment), changing the local 110 # timezone environment variable causes the timezone in Python to be set 111 # to UTC no matter what self.TIME_ZONE is. 112 if hasattr(time, 'tzset'): 113 # move the time zone info into os.environ 114 os.environ['TZ'] = self.TIME_ZONE 110 115 111 116 def get_all_members(self): 112 117 return dir(self) -
django/conf/project_template/settings.py
18 18 19 19 # Local time zone for this installation. All choices can be found here: 20 20 # http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE 21 # If running in a Windows environment this must be set to the same as your system time zone. 21 22 TIME_ZONE = 'America/Chicago' 22 23 23 24 # Language code for this installation. All choices can be found here: -
docs/settings.txt
827 827 environment variable, and it'll be up to you to ensure your processes are 828 828 running in the correct environment. 829 829 830 Note to Windows users: Django can not reliably use alternate time zones in a 831 Windows environment. When running Django on Windows this variable must be set 832 to match the system timezone. You can read more about that in this `bug report (#2315)`_ 833 834 .. _bug report (#2315): http://code.djangoproject.com/ticket/2315 835 830 836 URL_VALIDATOR_USER_AGENT 831 837 ------------------------ 832 838