parameters: (self, context, *inputArgs)
return_statement: return args[0]
docstring: Convert a date/time string in a specified format into a pubDate. The default is the
          MNV item format
          return the formatted pubDate string
          return on error return the original date string
docstring_summary: Convert a date/time string in a specified format into a pubDate. The default is the
          MNV item format
          return the formatted pubDate string
          return on error return the original date string
docstring_tokens: Convert a date / time string in a specified format into a pubDate . The default is the MNV item format return the formatted pubDate string return on error return the original date string
function: def pubDate(self, context, *inputArgs):
          '''Convert a date/time string in a specified format into a pubDate. The default is the
          MNV item format
          return the formatted pubDate string
          return on error return the original date string
          '''
          args = []
          for arg in inputArgs:
              args.append(arg)
          if args[0] == '':
              return datetime.datetime.now().strftime(self.pubDateFormat)
          index = args[0].find('+')
          if index == -1:
              index = args[0].find('-')
          if index != -1 and index > 5:
              args[0] = args[0][:index].strip()
          args[0] = args[0].replace(',', '').replace('.', '')
          try:
              if len(args) > 1:
                  args[1] = args[1].replace(',', '').replace('.', '')
                  if args[1].find('GMT') != -1:
                      args[1] = args[1][:args[1].find('GMT')].strip()
                      args[0] = args[0][:args[0].rfind(' ')].strip()
                  try:
                      pubdate = time.strptime(args[0], args[1])
                  except ValueError:
                      if args[1] == '%a %d %b %Y %H:%M:%S':
                          pubdate = time.strptime(args[0], '%a %d %B %Y %H:%M:%S')
                      elif args[1] == '%a %d %B %Y %H:%M:%S':
                          pubdate = time.strptime(args[0], '%a %d %b %Y %H:%M:%S')
                  if len(args) > 2:
                      return time.strftime(args[2], pubdate)
                  else:
                      return time.strftime(self.pubDateFormat, pubdate)
              else:
                  return datetime.datetime.now().strftime(self.pubDateFormat)
          except Exception as err:
              sys.stderr.write('! Error: pubDate variables(%s) error(%s)\n' % (args, err))
          return args[0]
function_tokens: def pubDate ( self , context , * inputArgs ) : args = [ ] for arg in inputArgs : args . append ( arg ) if args [ 0 ] == '' : return datetime . datetime . now ( ) . strftime ( self . pubDateFormat ) index = args [ 0 ] . find ( '+' ) if index == - 1 : index = args [ 0 ] . find ( '-' ) if index != - 1 and index > 5 : args [ 0 ] = args [ 0 ] [ : index ] . strip ( ) args [ 0 ] = args [ 0 ] . replace ( ',' , '' ) . replace ( '.' , '' ) try : if len ( args ) > 1 : args [ 1 ] = args [ 1 ] . replace ( ',' , '' ) . replace ( '.' , '' ) if args [ 1 ] . find ( 'GMT' ) != - 1 : args [ 1 ] = args [ 1 ] [ : args [ 1 ] . find ( 'GMT' ) ] . strip ( ) args [ 0 ] = args [ 0 ] [ : args [ 0 ] . rfind ( ' ' ) ] . strip ( ) try : pubdate = time . strptime ( args [ 0 ] , args [ 1 ] ) except ValueError : if args [ 1 ] == '%a %d %b %Y %H:%M:%S' : pubdate = time . strptime ( args [ 0 ] , '%a %d %B %Y %H:%M:%S' ) elif args [ 1 ] == '%a %d %B %Y %H:%M:%S' : pubdate = time . strptime ( args [ 0 ] , '%a %d %b %Y %H:%M:%S' ) if len ( args ) > 2 : return time . strftime ( args [ 2 ] , pubdate ) else : return time . strftime ( self . pubDateFormat , pubdate ) else : return datetime . datetime . now ( ) . strftime ( self . pubDateFormat ) except Exception as err : sys . stderr . write ( '! Error: pubDate variables(%s) error(%s)\n' % ( args , err ) ) return args [ 0 ]