1. today, when I made a webservice interface, I was asked to pass a timestamp, and then I started searching for it on Google. two problems are encountered: 1. The current time is converted to the timestamp. 2. The difference between the obtained current time and the system time is 8 hours. 1, the conversion method is NSString * timeSp = [NSString stringWithFormat: @ "% d", (long) [localeDate timeIntervalSince1970]; NSLog (@ "timeSp: % @", timeSp ); // The timestamp value 2 converts the obtained time to the current time NSDate * datenow = [NSDate date]; // the current time, the output shows the format NSTimeZone * zone = [NSTimeZone systemTimeZone]; NSInteger interval = [zone secondsFromGMTForDate: datenow]; NSDate * localeDate = [datenow dateByAddingTimeInterval: interval]; NSLog (@ "% @", localeDate); 3. NSDate * confromTimesp = [NSDate dateWithTimeIntervalSince1970: 1363948516]; NSLog (@ "1363948516 = % @", confromTimesp); 4. complete