I am trying to format a NSDate from a NSString:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"EEEE, dd.MM.yyyy"];
NSString * appStart = [appointment start];
NSLog(@"app start: %@", appStart);
NSString *startDateFormatted = [dateFormatter stringFromDate:appStart];
NSLog(@"formatted date: %@", startDateFormatted );
Output:
2012-12-31 15:21:04.722 App[3296:907] app start: 2012-12-31 15:00:00
2012-12-31 15:21:04.723 App[3296:907] formatted date: (null)
What am I doing wrong?
stringFromDatetakes aNSDate* as an argument and notNSString*. If you need further help with that let me know…