mirror of
https://github.com/django/django.git
synced 2025-07-25 06:04:21 +00:00
Fixed #17715 -- Updated the tutorial for time zone support, plus a few other improvements.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17591 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
26d12af6fd
commit
e0d78f898f
7 changed files with 88 additions and 56 deletions
|
@ -32,6 +32,9 @@ class UTC(tzinfo):
|
|||
Used only when pytz isn't available.
|
||||
"""
|
||||
|
||||
def __repr__(self):
|
||||
return "<UTC>"
|
||||
|
||||
def utcoffset(self, dt):
|
||||
return ZERO
|
||||
|
||||
|
@ -60,6 +63,9 @@ class LocalTimezone(tzinfo):
|
|||
self.DSTDIFF = self.DSTOFFSET - self.STDOFFSET
|
||||
tzinfo.__init__(self)
|
||||
|
||||
def __repr__(self):
|
||||
return "<LocalTimezone>"
|
||||
|
||||
def utcoffset(self, dt):
|
||||
if self._isdst(dt):
|
||||
return self.DSTOFFSET
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue