后台数据返回的是这样的带T的时间戳:
时间戳:
2013-08-28T13:07:53+00:00
解析方法:
NSDateFormatter*dateFormat = [[NSDateFormatteralloc]init];
[dateFormatsetDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ssZZZZ"];
NSDate*date = [dateFormatdateFromString:timeString];
NSString * timeStr = [dateFormatsetDateFormat:@"yyyy-MM-dd HH:mm:ss"];
网友评论