How can I figure out the day difference in the following example
I am calculating the day difference between two dates, but I figured out the the following code is actually giving me the difference for 24 hours rather than the difference in date. I have the following code: func daysBetweenDate(startDate: NSDate, endDate: NSDate) -> Int { let calendar = NSCalendar.currentCalendar() let components = calendar.components([.Day], fromDate:startDate, toDate: endDate, options: []) return components.day } So, for the following example I get this result: lastLaunch:2016-06-10 01:39:07 +0000 toady: 2016-06-11 00:41:41 +0000 dayDiff:0 I would have expected the day