mirror of
https://github.com/Hopiu/django.git
synced 2026-04-05 23:51:05 +00:00
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
This commit is contained in:
parent
c7739e30b2
commit
8a160d5de1
1 changed files with 1 additions and 2 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue