0
我有以下代碼:UNIX時間戳小時前
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];
然而,這似乎並沒有正確小時前返回。我在這裏做錯了什麼?