Question

e.g.

I have this current value GMT+8 ..or GMT+9 how do I obtain the city name of this timezone?

like *GMT+8 should output "MANILA"

or *GMT+9 should output "TOKYO"

is that possible? THANKS!

*depending on the iPhone settings located on the settings app

Was it helpful?

Solution

Try this:

NSTimeZone *cur = [NSTimeZone localTimeZone];
NSString *name = [cur name];
NSLog(@"%@",name);

The output will be like this:

Asia/Dhaka

For your case, construct a NSTimeZone object with your desired time zone then use this process to get the city name.

Hope this helps.. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top