Why does the result of using the variable today rather than Date() when calculating the number of days between two dates make a difference in swift?
var numDays: Int
var today = Date()
var twoWeeksFromNow: Date = Calendar.current.date(byAdding: .day,
value: 14, to: Date())!
var numDaysWithDate: Int =
Calendar.current.dateComponents([.day], from: Date(), to:
twoWeeksFromNow).day!
var numDaysWithToday: Int =
Calendar.current.dateComponents([.day], from: today, to:
twoWeeksFromNow).day!
print(numDaysWithDate) // 13
print(numDaysWithToday) // 14