I'm using this code to compare two dates and return the number of difference in days. I want to use it and get the minutes and the Hours, but I get the same number.
NSDate *todaysDate =[NSDate date];
NSDate *eventDate = [self.event objectForKey:@"eventDate"];
NSDateComponents *components = [[NSCalendar currentCalendar] components: NSDayCalendarUnit
fromDate: todaysDate toDate: eventDate options: 0];
NSInteger days = [components day];
NSInteger hours = [components hour];
NSLog(@"Number of days %ld", days);
NSLog(@"Number of hours %ld", hours);
the eventDate its on this format "2014-08-08 13:11:00 +0000"
What I always get in return for the number of hour or minutes is "9223372036854775807".