Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use `usegmt` flag in formatdate

Slightly cleaner and faster than string manipulation.
This flag has been available since Python 2.4:
  • Loading branch information...
commit 8a160d5de1763614ab1a86107e779b0afd151ade 1 parent c7739e3
@evansd evansd authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  django/utils/
3  django/utils/
@@ -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):
Please sign in to comment.
Something went wrong with that request. Please try again.