mrugen munshi
mrugen munshi

Reputation: 3607

Can i get the timezone as we get the clock application in iphone

Can we get the timezone similar to what is shown in the clock application? I am getting timezone array like this:

NSDictionary *TimeZoneArray = [NSTimeZone abbreviationDictionary];

Through this I am getting array for continent, now I am getting data like: Asia/Kabul,Asia/Muscat,Asia/Kuala_Lumpur,Asia/Hong_Kong but I want data something like this: Asia/India/Delhi, Asia/India/Kolkata,Asia/India/Mumbai.

Hope I am clear with my question.

What I want is name of continent with country name and then city name.

Upvotes: 4

Views: 1063

Answers (3)

Anurag Sharma
Anurag Sharma

Reputation: 4824

here is the new one:

/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZone.prefPane/Contents/Resources/all_cities_adj.plist

Upvotes: 0

mrugen munshi
mrugen munshi

Reputation: 3607

The possible solution is
/System/Library/PrivateFrameworks/AppSupport.framework/all_cities_adj.plist file We can get data from that plist.

Source is Where is the iPhone's Date & Time getting its time zone list

Upvotes: 1

Nathanial Woolls
Nathanial Woolls

Reputation: 5291

Try the following:

NSLog(@"Timezone is %@", [NSTimeZone systemTimeZone].name);

You'll need to parse the response string but that should be fairly trivial.

Upvotes: 3

Related Questions