Possible Duplicate:
NSDateFormatter and yyyy-MM-dd
I have an NSDate variable in format yyyy-MM-dd that I want to convert to dd/MM/yyyy. How can I do it?
NSDateFormatter *f = [[NSDateFormatter alloc] init];
[f setDateFormat:@"yyyy-MM-dd"];
NSDate *date = [f dateFromString:[[jugador objectAtIndex:0] valueForKey:@"FECHA_NAC"]];
Thanks
Using same NSDateformatter u can format date using setDateFormat and retreive date using dateFromString
For example :
EDIT : changes in code of
example