开发者

Parsing date in Objective-C

开发者 https://www.devze.com 2023-01-06 21:15 出处:网络
How can 开发者_运维百科I parse this into an objective-c NSDate most efficiently? \"2010-07-13T11:22:33-07:00\"

How can 开发者_运维百科I parse this into an objective-c NSDate most efficiently?

"2010-07-13T11:22:33-07:00"

This is what I tried

NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"yyyy-MMM-dd'T'HH:mm:ssZ"];

but did not work


have a look here, i had that issue

"The format that I am being given is halfway between RFC 822 and GMT. if i change the "+00:00" to "+0000" then I can use the "Z" on my format. and if i change it to "GMT+00:00" then I can use ZZZZ to get the data properly. It seems that something has been stripped out to handle this hybrid as it was working for me before with OS 3.x"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号