-(NSString*)changeNumToTime:(NSString*)str {
NSDate *date = [NSDate dateWithTimeIntervalSince1970:[str integerValue]/1000];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat: @"yyyy-MM-dd HH:mm:ss"];
NSString *showtime = [dateFormatter stringFromDate:date];
return showtime;
}
eg: str = @"1441047302"时,返回的showtime = @"1970-01-18 00:17:27"。
时间: 2024-10-05 03:41:09