As @Leo Natan said, - [NSDate description]
always gives date in GMT timezone. If you want to convert into local timezone then use following code.
NSString *dateStr = @"2013-12-20 12:10:40";
// Convert string to date object
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter setDateFormat: @"yyyy-MM-dd HH:mm:ss"];
NSDate *lastUpdatedate = [dateFormatter dateFromString:dateStr];
NSLog(@"lastUpdatedate : %@",[self getLocalTime:lastUpdatedate]);
-(NSDate *) getLocalTime:(NSDate *)date {
NSTimeZone *tz = [NSTimeZone defaultTimeZone];
NSInteger seconds = [tz secondsFromGMTForDate: date];
return [NSDate dateWithTimeInterval: seconds sinceDate: date];
}
OUTPUT:
lastUpdatedate : 2013-12-20 12:10:40 +0000