I'm trying create a Date
object with day, month and year, but the function of Calendar is returning nil
.
let calendar = Calendar.current
let date = calendar.dateComponents([.day,.month,.year], from: Date()).date! // <- nil
How I create a Date
object only with day, month and year?