2017-07-26 19 views

回答

0

在斯威夫特,你可以用这个z format参数:

let zone = TimeZone.current.identifier 
print(zone) 

在Objective-C,你可以使用这个:

NSTimeZone* timeZone = [NSTimeZone timeZoneWithAbbreviation:@"IST"]; 

NSString* timeZoneName = [timeZone localizedName:NSTimeZoneNameStyleStandard 
              locale:[NSLocale currentLocale]]; 
NSLog(@"Name : %@", timeZoneName); 
+0

这不是你从'timeZone.name'得到的吗? – Sulthan

相关问题