I have a string '2015-06-23T15:43:04.000+05:30' and i want to convert a date format like 23 June 2015 15:43
Try this one's:
NSString *temp = @"2015-06-23T15:43:04.000+05:30";
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"YYYY-MM-dd'T'HH:mm:ss.SSS'+05:30'"];
NSDate *dte = [dateFormat dateFromString:temp];
NSLog(@"Date: %@", dte);
NSDateFormatter *dF = [[NSDateFormatter alloc] init];
[dF setDateFormat:@"dd MMMM yyyy HH:mm"];
NSLog(@"%@", [dF stringFromDate:dte]);
In Console:
Date: 2015-06-23 12:43:04 +0000
23 June 2015 15:43
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments