CCT is UTC + 6:30 and SGT is UTC + 8:00. However result is wrong
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMMM dd, yyyy h:mm"];
// The date in your source timezone (eg. EST)
NSDate* sourceDate = [NSDate date];
NSLog([formatter stringFromDate:sourceDate]);
NSTimeZone* sourceTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"SGT"];
//NSTimeZone* destinationTimeZone = [NSTimeZone systemTimeZone];
NSTimeZone* destinationTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"CCT"];
NSInteger sourceGMTOffset = [sourceTimeZone secondsFromGMTForDate:sourceDate];
NSInteger destinationGMTOffset = [destinationTimeZone secondsFromGMTForDate:sourceDate];
NSTimeInterval interval = destinationGMTOffset - sourceGMTOffset;
NSDate* destinationDate = [[[NSDate alloc] initWithTimeInterval:interval sinceDate:sourceDate] autorelease];
NSLog([formatter stringFromDate:destinationDate]);
Result is look like that
2010-10-06 14:45:41.143 TimeZone[4805:207] October 06, 2010
2:45 2010-10-06 14:45:41.144 TimeZone[4805:207] October 06, 2010 6:45
I change to
NSTimeZone* destinationTimeZone = [NSTimeZone timeZoneWithName:@"Asia/Rangoon"];
it's working fine. Why not work with timeZoneWithAbbreviation