Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSDateFormatter *dateFormat = [NSDateFormatter new];
- [dateFormat setDateFormat:@"dd-LL-yy"];
- NSDate *date = [dateFormat dateFromString:@"25.05.16"];
- 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");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement