def format_date(utc, isoformat=False):
 u = datetime.strptime(utc.replace('+0000', 'UTC'), '%a %b %d %H:%M:%S %Z %Y')
 unew = datetime.combine(u.date(), time(u.time().hour, u.time().minute, u.time().second, tzinfo=UTC))
 unew = unew.astimezone(Local)
 if isoformat:
  return unew.isoformat()
 else:
  return unew.strftime('%Y-%m-%d %H:%M:%S %Z')

def format_date ( utc , isoformat = False ) : u = datetime . strptime ( utc . replace ( '+0000' , 'UTC' ) , '%a %b %d %H:%M:%S %Z %Y' ) unew = datetime . combine ( u . date ( ) , time ( u . time ( ) . hour , u . time ( ) . minute , u . time ( ) . second , tzinfo = UTC ) ) unew = unew . astimezone ( Local ) if isoformat : return unew . isoformat ( ) else : return unew . strftime ( '%Y-%m-%d %H:%M:%S %Z' )
return a date formatted as a string using a subset of qts formatting codes .