I have ios application with datetimepicker, and i am store the date in to database with "date" type. so it will store some number
date come from database and display in NSString like this : 2012-06-25 06:45:06 +0000
This is will give me GMT 0 and i want this time to GMT +5:30 and display it in to texlfield.
strTime = @"2012-06-25 06:45:06 +0000";// thats comes form database like this.
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd hh:mm"];
NSDate *myDate = [dateFormat dateFromString:strTime];
NSString *strDate = [dateFormat stringFromDate:myDate];
NSLog(@"%@", strDate);
txtTime.text = strDate;
the result will be (null) i want to display the time like 2012-06-25 12:15:06 (with gmt +5:30)