标签:
NSDate *currentDate = [NSDate date]; NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:currentDate]; NSDate *today = [calendar dateFromComponents:components]; components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:self.birthday]; NSDate *otherDate = [calendar dateFromComponents:components]; if([today isEqualToDate:otherDate]) {
NSLog(@"today");
}
标签:
原文地址:http://www.cnblogs.com/kaysun/p/5519791.html