diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-09-15 21:57:25 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-09-15 21:57:25 +0000 |
| commit | ca33d307dee3cf68cc9cd2ccfae00c7ff23ea890 (patch) | |
| tree | e0f0afa392f4ab50de4a89e2a0b1b4cc53f40794 /django/utils/dateformat.py | |
| parent | 7325fbf4ff20f9b0f21d3a1aba1abaca78a765d7 (diff) | |
queryset-refactor: Merged to [6300]
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/dateformat.py')
| -rw-r--r-- | django/utils/dateformat.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py index d5f3499d82..0e6541c721 100644 --- a/django/utils/dateformat.py +++ b/django/utils/dateformat.py @@ -248,10 +248,15 @@ class DateFormat(TimeFormat): return doy def Z(self): - """Time zone offset in seconds (i.e. '-43200' to '43200'). The offset - for timezones west of UTC is always negative, and for those east of UTC - is always positive.""" - return self.timezone.utcoffset(self.data).seconds + """ + Time zone offset in seconds (i.e. '-43200' to '43200'). The offset for + timezones west of UTC is always negative, and for those east of UTC is + always positive. + """ + offset = self.timezone.utcoffset(self.data) + # Only days can be negative, so negative offsets have days=-1 and + # seconds positive. Positive offsets have days=0 + return offset.days * 86400 + offset.seconds def format(value, format_string): "Convenience function" |
