def expires(delta):
 try:
  datetime
 except NameError:
  raise Exception, 'requires Python 2.3 or later'
 if isinstance(delta, (int, long)):
  delta = datetime.timedelta(seconds=delta)
 o = (datetime.datetime.utcnow() + delta)
 header('Expires', o.strftime('%a, %d %b %Y %T GMT'))

def expires ( delta ) : try : datetime except NameError : raise Exception , 'requires Python 2.3 or later' if isinstance ( delta , ( int , long ) ) : delta = datetime . timedelta ( seconds = delta ) o = ( datetime . datetime . utcnow ( ) + delta ) header ( 'Expires' , o . strftime ( '%a, %d %b %Y %T GMT' ) )
outputs an expires header for delta from now .