时间戳比较

 // 不要删除一下内容
//     NSDateFormatter *date=[[NSDateFormatter alloc] init];
//     [date setDateFormat:@"yyyy-MM-dd"];
//     NSDate *d=[date dateFromString:theDate];
//     NSLog(@"%@", d);
//     NSTimeInterval late=[d timeIntervalSince1970]*1;
//
//     NSRange range = NSMakeRange(0,(stringTime.length-3));
//     NSString* prefix = [stringTime substringWithRange:range];
//
//    NSString* prefix = @"1441030271";
//     NSTimeInterval time=[prefix doubleValue];
//     NSTimeInterval cha=time-late;
//     NSString *timeString=@"";
//     if (cha/86400>1)
//     {
//         timeString = [NSString stringWithFormat:@"%f", cha/86400];
//         timeString = [timeString substringToIndex:timeString.length-7];
//         return [timeString intValue];
//     }
//     return -1;

你可能感兴趣的:(时间戳比较)