I\'m getting Response from Webservices Date like \"2012-08-17T00:00:00\". I want to Display Date only like 17-08-2012. How Change Date format and Remove that time...
NSDate *today = [NSDate date];
NSLog(@"Date today: %@", today);
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init] ;
dateFormat.dateFormat = @"dd-MM-yyyy";
NSString *dateString = [dateFormat stringFromDate:today];
NSLog(@"Date: %@", dateString);
Also see the below date and time format styles
NSDateFormatterNoStyle NSDateFormatterShortStyle NSDateFormatterMediumStyle NSDateFormatterLongStyle NSDateFormatterFullStyle
You can set it like [dateFormat setDateStyle:NSDateFormatterShortStyle];