我有以下代码:
NSDate *commentPostedDate = [[NSDate alloc] initWithTimeIntervalSince1970:[self.newsFeedStream_.timestamp_ intValue]];
NSLog(@"TIMESTAMP IS %@", self.newsFeedStream_.timestamp_);
int interval = (int) [[NSDate date] timeIntervalSinceDate:commentPostedDate] / 60;
[commentPostedDate release];
NSString *timePosted = [NSString stringWithFormat:@"%d hours ago", interval];
然而,这似乎并没有在几个小时前返回正确的。我在这里做错了什么?