def _format_date(pdb_date):
 date = ''
 year = int(pdb_date[7:])
 if (year < 50):
  century = 2000
 else:
  century = 1900
 date = (str((century + year)) + '-')
 all_months = ['xxx', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
 month = str(all_months.index(pdb_date[3:6]))
 if (len(month) == 1):
  month = ('0' + month)
 date = (((date + month) + '-') + pdb_date[:2])
 return date

def _format_date ( pdb_date ) : date = '' year = int ( pdb_date [ 7 : ] ) if ( year < 50 ) : century = 2000 else : century = 1900 date = ( str ( ( century + year ) ) + '-' ) all_months = [ 'xxx' , 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' , 'Jul' , 'Aug' , 'Sep' , 'Oct' , 'Nov' , 'Dec' ] month = str ( all_months . index ( pdb_date [ 3 : 6 ] ) ) if ( len ( month ) == 1 ) : month = ( '0' + month ) date = ( ( ( date + month ) + '-' ) + pdb_date [ : 2 ] ) return date
convert a datetime into an rfc 822 formatted date input date must be in gmt .