You can enumerate the known time zones, and check each one to see if it has the same offset as your desired time zone. My test program:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"GMT+5:30"];
NSInteger secondsFromGMT = timeZone.secondsFromGMT;
for (NSString *name in [NSTimeZone knownTimeZoneNames]) {
NSTimeZone *candidate = [NSTimeZone timeZoneWithName:name];
if (candidate.secondsFromGMT == secondsFromGMT) {
NSLog(@"%@ is currently the same offset from GMT as %@", candidate.name, timeZone.name);
}
}
}
return 0;
}
The output:
2014-09-09 09:09:01.897 timezone[87091:303] Asia/Colombo is currently the same offset from GMT as GMT+0530
2014-09-09 09:09:01.898 timezone[87091:303] Asia/Kolkata is currently the same offset from GMT as GMT+0530
Apparently there are two time zones with the same offset as GMT+5:30
. (There can be many more for other offsets; try GMT-0500
for example.) It's up to you to decide which one you want to use.