Commit 8561d0d6 authored by 's avatar

Merged rfc1123 date func tweak from branch

parent 54e2f310
......@@ -85,18 +85,16 @@
"""Commonly used utility functions."""
__version__='$Revision: 1.3 $'[11:-2]
__version__='$Revision: 1.4 $'[11:-2]
from time import time, asctime, gmtime
import sys, os
import sys, os, time
from string import split, rfind
def rfc1123_date(t=None, time=time, asctime=asctime, gmtime=gmtime,
split=split):
# Return an RFC 1123 format date string.
t=split(asctime(gmtime(t or time())))
return '%s, %s %s %s %s GMT' % (t[0],t[2],t[1],t[4],t[3])
def rfc1123_date(ts=None, format='%a, %d %b %Y %H:%M:%S GMT'):
# Return an RFC 1123 format date string
if ts is None: ts=time.time()
return time.strftime(format, time.gmtime(ts))
def absattr(attr, c=callable):
# Return the absolute value of an attribute,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment