import time


def http_time(value=None):
    """Format a timestamp for HTTP headers"""

    if value == None:
        value = time.time()
    return time.strftime('%a, %d %b %Y %H:%M:%S GMT',
                         time.gmtime(value))