//实例化一个NSDateFormatter对象
NSDateFormatter* dateFormat = [[NSDateFormatter alloc] init];
//设定时间格式,这里可以设置成自己需要的格式
[dateFormatsetDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate*date =[dateFormatdateFromString:@"2019-07-05 12:00:01"];
NSTimeInterval timeBetween = [[NSDatedate]timeIntervalSinceDate:date];
if(timeBetween >0) {
//到期
}else{
//未到期
}