// // Example of formatting the date string // "Tue, 16 Dec 2008 11:45:13 +0000" // to // "16. December 2008" // NSString *feedDateString = @"Tue, 16 Dec 2008 11:45:13 +0000"; // // A formatter to create a date using the RFC2822 date of a RSS feed NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init]; // Note: We have to force the locale to "en_US" to avoid unexpected issues formatting data NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; [inputFormatter setLocale: usLocale]; [usLocale release]; // set the format based on an RFC2822 date format [inputFormatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss Z"]; // create a NSDate object using the NSDateFormatter NSDate *formattedDate = [inputFormatter dateFromString: feedDateString]; // format the date created before to a format of your choice, such as "16. December 2008" NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; [outputFormatter setDateFormat:@"d'.' MMMM yyyy"]; NSLog(@"formattedDateString : '%@'", [outputFormatter stringFromDate:formattedDate]); [inputFormatter release]; [outputFormatter release];