我得到 JSON Parse Date,我想使用 NSDateFormatter,但没有成功。
1.JSON 获取控制台日志
IncidentReceiveTime = "/Date(1353914100000+0800)/";
2.我的代码
NSString *dateStr =[NSString stringWithFormat:@"%@",[[[DateSortArry objectAtIndex:0] objectForKey:@"IncidentReceiveTime"]stringByReplacingOccurrencesOfString:@"/" withString:@""]];
NSLog(@"dateStr:%@",dateStr);
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setLocale:[NSLocale currentLocale]];
[dateFormatter setDateFormat:@"yyyy-MM-ddHH"];
NSDate *date = [dateFormatter dateFromString:dateStr];
NSLog(@"date:%@",date);
3.NSDateFormatter控制台日志
dateStr:Date(1361943694000+0800)
date:(null)