make global function
func convertDateFormat(inputDate: String) -> String {
let olDateFormatter = DateFormatter()
olDateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss"
let oldDate = olDateFormatter.date(from: inputDate)
let convertDateFormatter = DateFormatter()
convertDateFormatter.dateFormat = "MMM dd yyyy h:mm a"
return convertDateFormatter.string(from: oldDate!)
}
Called function and pass value in it
get_OutputStr = convertDateFormat(inputDate: "2019-03-30T05:30:00+0000")
and here is output
Feb 25 2020 4:51 PM