Comparar duas datas
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
NSDate *date1; NSDate *date2; if ([date1 compare:date2] == NSOrderedDescending) { NSLog(@"date1 is later than date2"); } else if ([date1 compare:date2] == NSOrderedAscending) { NSLog(@"date1 is earlier than date2"); } else { NSLog(@"dates are the same"); } |