I\'ve been looking around but I haven\'t seen anything that addresses this so I\'m hoping someone can help clear this up for me. What I am trying to do is use an NSDate variable
Swift 4 If you want to use time with today's date
let todate = Date()
let formater = DateFormatter()
formater.dateFormat = "yyyy:MM:dd"
let date = formater.string(from: todate)
print(date)
let completeDate = date + ":9:00AM"
print(completeDate)
let anotherFormater = DateFormatter()
anotherFormater.dateFormat = "EEEEE MMMMM yyyy HH:mm:ss.SSSZ"
anotherFormater.date(from: completeDate)
if you want to add time in any date then:-
let completeDate = "2019-02-15" + ":9:00AM"
print(completeDate)
let anotherFormater = DateFormatter()
anotherFormater.dateFormat = "EEEEE MMMMM yyyy HH:mm:ss.SSSZ"
anotherFormater.date(from: completeDate)