-
(BOOL)checkProductDate:(NSString *)tempDate {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
NSDate *date = [dateFormatter dateFromString:tempDate];
// 判断是否大于当前时间
if ([date earlierDate:[NSDate date]] != date) {
return true;
} else {
return false;
}
}
网友评论