I am trying to get a time to set in a DatePicker. I want a date that has the format "HH:mm". This is my current code:
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "HH:mm"
let date = dateFormatter.date(from: "09:00")
print(String(describing: date))
picker.date = date!
However date is always nil. Where am I going wrong? Thanks.