How to change date format in Ruby : I'm stuck on a question. How to return the incoming dates with the valid formats?

 I want to change_date_format(["2010/03/30","15/12/2016","11-15-2012, 20130720"] should return the list ["20100330","2016215", "2012115"]

    def change_date_format(dates)
      return []
    end
    
    p change_date_format(["2010/03/30", "15/12/2016", "11-15-2012", "20130720"])