Display current time in epoch
问题 I'm trying to display the current time in epoch, i'm not sure if this is correct, but i'm sure it's not since it's giving me an error: NSDate *currentDate = [NSDate date]; NSDate *epochDate = [NSDate dateWithTimeIntervalSince1970:currentDate]; Any idea of how to accomplish this? 回答1: NSString *epochTime = @"1347522689"; NSTimeInterval epochInterval = [epochTime longLongValue]; NSDate *epochNSDate = [[NSDate alloc] initWithTimeIntervalSince1970:epochInterval]; NSDateFormatter