code: def convert_date_columns(df, date_format='epoch'):
      
  
      if date_format not in ['epoch', 'iso']:
          if '%' in date_format:
              try:
                  datetime.datetime.now().strftime(date_format)
              except:
                  raise DateConversionError('Error serializing dates in DataFrame using format {}.'.format(date_format))
              finally:
                  for column, data_type in df.dtypes.to_dict().items():
                      if 'date' in str(data_type):
                          df[column] = df[column].dt.strftime(date_format)
          else:
              raise DateConversionError('Error serializing dates in DataFrame using format {}.'.format(date_format))
  
      return df
docs: Convert dates/datetimes to preferred string format if specified
          i.e. '%Y-%m-%d', 'epoch', 'iso'