1.比较两个日期之间的时间差距
// 1.日历对象(标识:时区相关的标识)
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
// 2.合并标记
NSUInteger flags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
// 3.比较
return [calendar components:flags fromDate:from toDate:to options:0];