iPhone : How to convert date?
My date is coming 开发者_如何转开发in string format from server
Output of date come like this "07/30/2011",
I want a date format "30 july"
how can i do that?
Easy, use NSDateFormatter
Example,
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"MM/dd/yyyy"];
NSDate *date = [dateFormatter dateFromString:@"07/30/2011" ];
[dateFormatter setDateFormat:@"dd MMM"];
NSString *output = [dateFormatter stringFromDate:date];
精彩评论