I'm trying to convert an NSDate to a "HH:mm" time string. In the past, I could use an NSDateFormatter's stringFromDate method, but now, it seems that method will only accept a Date (NOT NSDate) object. How can I do this? I will accept an answer that allows me to cast an NSDate as a Date, or that allows me to directly convert an NSDate to a formatted time string.
My casting attempts ("_time" contains an NSDate, and _date contains a Date. These don't compile):
let dateformatter = DateFormatter()
dateformatter.dateFormat = "HH:MM"
return dateformatter.string(from: (Date)_time)
And:
let myNSDate = NSDate(_date)