1、当前时间减去18年
+ (NSDate *)dateWithYearsBeforeNow:(NSInteger)year{
NSDate *currentDate = currentDate = [NSDate date];
NSCalendar *calendar = nil;
if (IOS8Higher) {
calendar = [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian];
} else {
calendar = [NSCalendar currentCalendar];
}
NSDateComponents *dateComponents = [calendar components:NSYearCalendarUnit fromDate:currentDate];
[dateComponents setYear:year * -1];
return [calendar dateByAddingComponents:dateComponents toDate:currentDate options:0];
}