may*_*uur 5 iphone xcode nsdate nsdateformatter
这是我的NSString,
myDate : 2011-06-07 11:23:47 0000
Run Code Online (Sandbox Code Playgroud)
这是代码,
NSTimeZone *currentDateTimeZone = [NSTimeZone defaultTimeZone];
NSDateFormatter *currentDateFormat = [[NSDateFormatter alloc]init];
[currentDateFormat setTimeZone:currentDateTimeZone];
[currentDateFormat setDateFormat:@"yyyy-MM-dd HH:mm:ss Z"];
NSDate *tempDate = [currentDateFormat dateFromString:second];
Run Code Online (Sandbox Code Playgroud)
仍然tempDate获得价值nil.
有人可以帮忙吗?
| 归档时间: |
|
| 查看次数: |
5498 次 |
| 最近记录: |