iphone - Convert date string to required date string format -


I have parsed the .ics file and getting the start date as a string, values ​​in the string are 20100803T130451Z (It is a date dated string), I want to convert this string to my required string format ....

My date is the required format of string (Tuesday - May 25, 2010 (by this way) )

Can anyone help me? Thanks in advance .....

Ole well, here's some sample code.

This:

  NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; [DateFormatter setDateFormat: @ "yyyyMMD'T'HHmmss'Z '"]; NSDate * date = [dateFormatter dateFromString: dateString];  

should convert to NSDTing's NSDT. You can change NSDateFormatters dateFormat to get your desired date format. Like this:

  [dateFormatter setDateFormat: @ "dddd - MMMM dd, yyy"]; NSString * myNiceLookingDate = [dateFormatter stringFromDate: date]; [DateFormatter release];  

This should work, although I have not tested it, but it will get the result of the least result.

Fun, Phil.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -