iOS 当前时间之前与当前时间之后比较

    NSComparisonResult result = [localeDate compare:csDate];

    if (result == NSOrderedDescending) {

        //在指定时间前面 过了指定时间 过期

        NSLog(@"历史回放");

    }

    else if (result == NSOrderedAscending){

        //没过指定时间 没过期

        NSLog(@"立即播放");

    }

猜你喜欢

转载自blog.csdn.net/f9999999995/article/details/86549141