I am trying to convert the date "01/12/2017" from string to date format but after converting it's giving me this format date 2017-12-01 00:00:00 +0000. But i want date in this format "01/12/2017" only.Here is my code.
func onlyDate(date: String) -> Date {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd/MM/yyyy"
dateFormatter.timeZone = TimeZone(abbreviation: "GMT+0:00")
let date1 = dateFormatter.date(from: date)
print(date1!)
return date1!
}