How to convert long-integer time to NSString or NSDate to display time?
问题 I got a serial number form Java Date which convert into long-integer such as "1352101337000". The problem I met is how to analyze this long-integer number back to NSDate or NSString so that I can clear to know what time the serial number is displaying. Do anybody have solution for this case? 回答1: Use this, NSTimeInterval timeInMiliseconds = [[NSDate date] timeIntervalSince1970]; To change it back, NSDate* date = [NSDate dateWithTimeIntervalSince1970:timeInMiliseconds]; As per apple