iOS 时间戳转时间

 1 +(NSString*)getTimeFromTimeStamp:(NSString*)dateStamp
 2 {
 3 
 4     NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:dateStamp.floatValue];
 5     NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
 6     [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.fff"];
 7     //转换成字符串
 8     NSString *timeStr = [formatter stringFromDate:confromTimesp];
 9     return timeStr;
10 }

 

posted @ 2017-02-23 11:41  福泽小院  阅读(125)  评论(0编辑  收藏  举报