Objective c 这个日期是什么格式?
我正在尝试为此日期编写NSDateFormatter格式。我需要使用什么格式将此字符串解析为NSDate 2007-07-01T00:00:00-04:00Objective c 这个日期是什么格式?,objective-c,ios,format,nsdate,nsdateformatter,Objective C,Ios,Format,Nsdate,Nsdateformatter,我正在尝试为此日期编写NSDateFormatter格式。我需要使用什么格式将此字符串解析为NSDate 2007-07-01T00:00:00-04:00 这是RFC3339日期。Apple文档中有一个解析此格式的示例: rfc3339DateFormatter = [[[NSDateFormatter alloc] init] autorelease]; enUSPOSIXLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US
这是RFC3339日期。Apple文档中有一个解析此格式的示例:
rfc3339DateFormatter = [[[NSDateFormatter alloc] init] autorelease];
enUSPOSIXLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease];
[rfc3339DateFormatter setLocale:enUSPOSIXLocale];
[rfc3339DateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
[rfc3339DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
date = [rfc3339DateFormatter dateFromString:rfc3339DateTimeString];