Currently i am working in iPhone application, Here i have using NSString to store (2012-07-11 11:49:55 +0000) and using NSDateFormatter to convert the date and time but the output comes 05:19:55, but i want 11:49:55, please any one help me
Here i tried the source code for your reference
NSString *dateString = [NSString stringwithformat:%@,(2012-07-11 11:49:55 +0000)];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"hh:mm:ss";
[dateFormatter setTimeZone:[NSTimeZone systemTimeZone]];
NSLog(@"The Current Time is %@",[dateFormatter stringFromDate:dateString]);
[dateFormatter release];
Your system time zone is not +0000. So the time is formatted according to it. The solution is to set same time zone to GMT (+0000).