[Solved] Date string convertion wrong month

[ad_1]

As you need please use below method. it will give you proper month formated date

func monthFormatechange(_ dateString : String) -> String
{

    let dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "dd-MM-yyyy"
    let date = dateFormatter.date(from:dateString)
    dateFormatter.dateFormat = "dd-MMM-yyyy"
    let actualDate = dateFormatter.string(from: date!)
    return actualDate
}

[ad_2]

solved Date string convertion wrong month