dateFromString返回nil

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.
有人可以帮忙吗?

Dee*_*olu 3

你是如何获得日期字符串的?它需要2011-06-07 11:23:47 +0000这样才能发挥作用。