求教:
created=@"Tue Jul 21 20:33:37 +0800 2015";
fmt.dateFormat=@"EEE MMM dd HH:mm:ss Z yyyy";
NSDate *createDate=[fmt dateFromString: created];
createDate为空值?!?!?
经过我检测,发现是EEE和MMM都不可使,其他正常!
究竟为什么呢?????
NSString *string = @"Fri Sep 19 2014";
NSDateFormatter *dateFmt = [[NSDateFormatter alloc] init];
[dateFmt setDateFormat:@"EEE MMM dd yyyy"];
NSDate *date = [dateFmt dateFromString:string];
NSLog(@"date:",date);
你代码确认是这样?跑出来没问题啊
NSString *created=@"Tue Jul 21 20:33:37 +0800 2015";
NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
fmt.dateFormat=@"EEE MMM dd HH:mm:ss Z yyyy";
NSDate *createDate=[fmt dateFromString: created];
输出结果:
Printing description of createDate:
2015-07-21 12:33:37 +0000
Printing description of createDate:
2015-07-21 12:33:37 +0000
本地跑出来的结果。。
是EEE和MMM都不可使,其他正常!
究竟为什么呢?????!!!!!!!