I need to show a date in a certain format on screen, but I need to store the date as a string in another format. I think this means I have to convert it to a date and back to a string.
How do i do this ?
I have already figured out how to convert my string to a date, however build analyser gives me a warning.
I want to convert the string from dd MM yyyy to yyyy-MM-dd
He my code so far...
NSString *startDateString = btnStartDate.titleLabel.text;
NSDateFormatter *dateStartFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateStartFormatter setDateFormat:@"dd MM yyyy"];
NSDate *datStartDate = [[NSDate alloc] init];
datStartDate = [dateStartFormatter dateFromString:startDateString];