に等しい私はあなたが何を言っていない。このは以上であるか、別の
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSLog(@"%@",[dateFormatter stringFromDate:[NSDate date]]);
NSString * TodayDate = [dateFormatter stringFromDate:[NSDate date]];
if ([displayList.fromTime compare:TodayDate] == NSOrderedDescending) {
NSLog(@"date1 is later than date2");
} else if ([displayList.toTime compare:date2] == NSOrderedAscending) {
NSLog(@"date1 is earlier than date2");
} else {
NSLog(@"dates are the same");
}
それは日が同じであり、時間が先行しているならば、それはNSOrderedDescendingを返しますので、それは、日付と時刻の両方を取るよりも大きいを行うか –
をequallすることが可能です。それでうまくいく。 – Nirmalsinh
@ManjuSSPはあなたのために働いていますか? – Nirmalsinh