diff options
| author | David Evans <drhevans@gmail.com> | 2013-08-07 12:00:39 +0100 |
|---|---|---|
| committer | David Evans <drhevans@gmail.com> | 2013-08-07 12:00:39 +0100 |
| commit | 8a160d5de1763614ab1a86107e779b0afd151ade (patch) | |
| tree | a908fbc0f47d9bddac3074643d4609a133245a1e /django/utils | |
| parent | c7739e30b20f55c2b055b12a628bfb5c2228ba4e (diff) | |
Use `usegmt` flag in formatdate
Slightly cleaner and faster than string manipulation.
This flag has been available since Python 2.4:
http://docs.python.org/2/library/email.util.html#email.utils.formatdate
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/http.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/django/utils/http.py b/django/utils/http.py index 4647d89847..e397acad5b 100644 --- a/django/utils/http.py +++ b/django/utils/http.py @@ -109,8 +109,7 @@ def http_date(epoch_seconds=None): Outputs a string in the format 'Wdy, DD Mon YYYY HH:MM:SS GMT'. """ - rfcdate = formatdate(epoch_seconds) - return '%s GMT' % rfcdate[:25] + return formatdate(epoch_seconds, usegmt=True) def parse_http_date(date): """ |
