标签:
/**
* @method
*
* @brief 获取两个日期之间的天数
* @param fromDate 起始日期
* @param toDate 终止日期
* @return 总天数
*/
+ (NSInteger)numberOfDaysWithFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate{
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
NSDateComponents * comp = [calendar components:NSCalendarUnitDay
fromDate:fromDate
toDate:toDate
options:NSCalendarWrapComponents];
return comp.day;
}
标签:
原文地址:http://www.cnblogs.com/lihaibo-Leao/p/5975902.html