I am having a Date String in this format \"2012-09-06 04:57:00.000\". I need to separate the time in that string in 04:57AM like that. help me out of this ?
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"hh:mm:ss a"]; NSString *timeStr = [formatter stringFromDate:[NSDate date]];
The above code is with ARC otherwise you need to release formatter like
formatter release