Am working in an iPhone app with using the NSDateFormatter. Am getting the time from the webservice like \"00:00:00\", \"16:00:00\",\"15:30:00\" and so on. I ne
Why are you again allocating the NSDateFormatter ?
you Just need to format it to NSDate and then again to NSString,
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:@"HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:dats1];
[dateFormatter setDateFormat:@"hh:mm a"];
NSString *formattedDate = [dateFormatter stringFromDate:date];
NSLog(@"%@",formattedDate);