When I compare the beginning to the end of the day of october 25, I get 89999 seconds (25 hours).
I compare the dates using the following method:
endOfDay.timeIntervalSinceDate(startOfDay)
However, when I compare the hours, I get 24. I use the following extension function of NSDate to compare hours.:
func differenceInHoursWith(date: NSDate) -> Int{
let components = NSCalendar.currentCalendar().components(.Hour, fromDate: self, toDate: date, options: [])
return components.hour
}
Is there a way to get the difference in seconds without day time adjustments ? In my case I do not need them and I need seconds granularity.