Though NSDateFormatter behaves slightly different than documented, the following might even be correct, as strange as it might look (mind the last two lines):
-(void)testNSDateFormatterTrap
{
NSDateFormatter *lower = init] autorelease];
lower.dateFormat = @”yyyy-MM-dd HH:mm:SS ZZZ”;
NSDateFormatter *upper = init] autorelease];
…
Ever tried to get e.g. the “Last-Modified” HTTP response header field into a NSDate object? That’s no real fun, because
this standard formatting isn’t digested by default,
the required format string doesn’t quite work as documented.
Let’s concentrate on “Full Date” according to RFC 1123:
NSString *src = @”Fri, 14 Aug 2009 14:45:31 GMT”;
The NSDateFormatter switched to Unicode …
¶
Posted 18 August 2009
† Marcus Rohrmoser
§
Articles in english § development
‡
°
Also tagged: Asctime, Cocoa, Date, HTTP Header, If-Modified-Since, iPhone, Last-Modified, NSDate, NSHTTPURLResponse, Objective C, Request Header, Response Header, RFC1123, RFC850, SenTestingKit