NSCalendar *gregorian = [[NSCalendaralloc] initWithCalendarIdentifier:NSGregorianCalendar];
[gregorian setFirstWeekday:2];
NSDateFormatter *dateFormatter = [[NSDateFormatteralloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *fromDate;
NSDate *toDate;
[gregorian rangeOfUnit:NSDayCalendarUnitstartDate:&fromDate interval:NULLforDate:[dateFormatter dateFromString:@"2016-10-12 00:00:00"]];
[gregorian rangeOfUnit:NSDayCalendarUnitstartDate:&toDate interval:NULLforDate:[NSDatedate]];
NSDateComponents *dayComponents = [gregoriancomponents:NSDayCalendarUnitfromDate:fromDate toDate:toDateoptions:0];
// dayComponents.day 即为间隔的天数
NSLog(@"--%d",dayComponents.day);