Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #2315 -- added work around for Windows timezone setting (i.e. w…

…e can't do

it). This will work until somebody wants to write some full Win32 timezone changing code for us. Thanks to Marc Fargas and SmileyChris for the combined patch.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 6c47577 commit 80e58b3211ae54754b734a409d5b944117d7963d @malcolmt malcolmt committed
1  AUTHORS
@@ -79,6 +79,7 @@ answer newbie questions, and generally made Django that much better:
Andy Dustman <>
Clint Ecker
Enrico <>
+ Marc Fargas <>
Eric Floehr <>
7 django/conf/
@@ -7,6 +7,7 @@
import os
+import time # Needed for Windows
from django.conf import global_settings
@@ -105,8 +106,10 @@ def __init__(self, settings_module):
self.INSTALLED_APPS = new_installed_apps
- # move the time zone info into os.environ
- os.environ['TZ'] = self.TIME_ZONE
+ if hasattr(time, 'tzset'):
+ # Move the time zone info into os.environ. See ticket #2315 for why
+ # we don't do this unconditionally (breaks Windows).
+ os.environ['TZ'] = self.TIME_ZONE
def get_all_members(self):
return dir(self)
2  django/conf/project_template/
@@ -18,6 +18,8 @@
# Local time zone for this installation. All choices can be found here:
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
5 docs/settings.txt
@@ -827,6 +827,11 @@ manual configuration option (see below), Django will *not* touch the ``TZ``
environment variable, and it'll be up to you to ensure your processes are
running in the correct environment.
+.. note::
+ Django cannot reliably use alternate time zones in a Windows environment.
+ When running Django on Windows this variable must be set to match the
+ system timezone.

0 comments on commit 80e58b3

Please sign in to comment.
Something went wrong with that request. Please try again.