How to use NSTimeZone -timeZoneWithName: with a city name from Rails ActiveSupport?
问题 If I only have the city name like Bangkok or Tokyo , how can I supply a timezone parameter in [NSTimeZone timeZoneWithName:@"Asia/Tokyo"] where it also has continent and slash in front of city? I already tried [NSTimeZone timeZoneWithName:@"Tokyo"] , it doesn't work. 回答1: Thanks for the answers guys, but it looks like those city names are just a format that Rails "ActiveSupport::TimeZone" uses. So I just have to map it back. The mapping is here -> http://api.rubyonrails.org/classes