From 8a160d5de1763614ab1a86107e779b0afd151ade Mon Sep 17 00:00:00 2001 From: David Evans Date: Wed, 7 Aug 2013 12:00:39 +0100 Subject: [PATCH] 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 --- django/utils/http.py | 3 +-- 1 file changed, 1 insertion(+), 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): """