Change date formate to another formate


func changeDateFormate(strDate : String) -> String
{
       let dateFormatter1 = DateFormatter()
       dateFormatter1.dateFormat = "MM-dd-yy"
       let getDate = dateFormatter1.date(from: strDate)
       dateFormatter1.dateFormat = "yyyy-MM-dd"
       return dateFormatter1.string(from: getDate!)
}