Revision f30ca1e6 lib/http/server.py

b/lib/http/server.py
59 59
"""
60 60

  
61 61

  
62
def _DateTimeHeader():
62
def _DateTimeHeader(gmnow=None):
63 63
  """Return the current date and time formatted for a message header.
64 64

  
65
  The time MUST be in the GMT timezone.
66

  
65 67
  """
66
  (year, month, day, hh, mm, ss, wd, _, _) = time.gmtime()
68
  if gmnow is None:
69
    gmnow = time.gmtime()
70
  (year, month, day, hh, mm, ss, wd, _, _) = gmnow
67 71
  return ("%s, %02d %3s %4d %02d:%02d:%02d GMT" %
68 72
          (WEEKDAYNAME[wd], day, MONTHNAME[month], year, hh, mm, ss))
69 73

  

Also available in: Unified diff