I have the following code which is simply getting the current date and converting it to the format YYYY-MM-dd HH:mm:ss zzz
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat: @"YYYY-MM-dd HH:mm:ss zzz"];
NSTimeZone *currentTimeZone = [NSTimeZone localTimeZone];
[dateFormatter setTimeZone:currentTimeZone];
NSString *time = [dateFormatter stringFromDate:[NSDate date]];
NSLog(@"TIME IS %@", time);
With this, I'm getting the following log output:
2014-12-30 00:20:38.987 MYAPPNAME[953:229825] TIME IS 2015-12-30 00:20:38 CST
Can someone tell me why the output is showing as 2015, rather than 2014 as it should be?