I want to retrieve year and then month from this kind of date: 2011-12-23 10:45:01 with no luck.
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]];
[dateFormatter setDateFormat:@"yyyy"];
NSLog(@"Date = %@",[dateFormatter dateFromString:@"2011-12-23 10:45:01"]);
[dateFormatter release];
Date = (null), i can't understand why.