我正在尝试从 NSString 格式化 NSDate:
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 );
输出:
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)
我究竟做错了什么?