Convert Date to required format – Ios swift
I need to convert "2022-01-20T00:00:00.000Z" to "dd MMM yyy" format. I have tried doing it as suggested in a stackoverflow answer but it returns nil func convertDate(date:String)-> String{ let dateFormatterGet = DateFormatter() dateFormatterGet.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" let dateFormatterPrint = DateFormatter() dateFormatterPrint.dateFormat…