Getting city and country from NSTimeZone
I'd like to (at least) get the name of the country for a time zone. This is not provided by any of the po开发者_开发知识库tential methods:
- name,
- localizedName:locale:,
- description
I notice that the built in iPhone clock App has access to this information, as it describes London as "London, England".
Thanks.
I'm sure that it works different with the built-in clock. There is a database of cities of which each has a country and a timezone.
And what would you expect from [myGMT city]
? Dublin or Casablanca?
From the description of the timeZoneWithName:data:
method, the filesystem has timezone information located at /usr/share/zoneinfo
.
I have no idea what the format of the files is, or if you can even read them from the application sandbox, but that's likely how the Clock application gets the information.
精彩评论