#pragma mark 字符串转时间
-(NSString *)DateFromString:(NSString *)strTime
{
NSString *time = [NSString stringWithFormat:@"%@",strTime];
NSInteger num = [time integerValue]/1000;
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:num];
NSString *confromTimespStr = [formatter stringFromDate:confromTimesp];
return confromTimespStr;
}
网络字符串 转 时间
最新推荐文章于 2019-10-24 16:53:12 发布