时间戳比较

 // 不要删除一下内容
//     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;

posted @ 2015-08-21 18:52  Dived  阅读(1299)  评论(0编辑  收藏  举报