51

I use timeZoneWithName, but I don't know names of timezones. Where can I find a list of timezones?

[NSTimeZone timeZoneWithName:@"US/Eastern"];
Cœur
  • 37,241
  • 25
  • 195
  • 267
Voloda2
  • 12,359
  • 18
  • 80
  • 130
  • 1
    This might have information on where to look: https://en.wikipedia.org/wiki/Tz_database – Greg Hewgill Mar 18 '12 at 20:14
  • http://twiki.org/cgi-bin/xtra/tzdatepick.html – Vladislav Rastrusny Mar 18 '12 at 20:28
  • 27
    This is a programming related question, because the timezone names might be different depending on plateform, OS versions... Those who voted this question off topic just didn't bother to understand it correctly. – Enzo Tran Oct 08 '12 at 12:54
  • 18
    This should not be closed. In order to use this method correctly, you need to understand its valid inputs. It is a useful reference to any developer using, say, NSDateFormatter. – Ben Flynn Mar 27 '13 at 22:21
  • Hi @GregHewgill, how does one know that NSTimezone use the exact same list as the list on Wikipedia? Besides, isn't Apple known for doing things its own way? – ericn Sep 25 '14 at 08:59

1 Answers1

82

I found solution.

NSLog(@"%@", [NSTimeZone knownTimeZoneNames]);
Voloda2
  • 12,359
  • 18
  • 80
  • 130
  • 12
    Since I can't post an answer, I've pasted this at pastebin.com. This is the whole list as of the latest iOS 6 release: http://pastebin.com/ibNU2RcG – Brett Jun 10 '13 at 18:14
  • If you want need more dynamic timezone regarding the name of the city for example you can use, in Swift: `let parisTimezoneName = NSTimeZone.knownTimeZoneNames().filter { $0.containsString("Paris") }.first; dateFormatter.timeZone = NSTimeZone(name: parisTimezoneName!)` – Artheyn Sep 13 '16 at 14:11
  • 1
    Or in Swift 4 just use print(TimeZone.abbreviationDictionary) – Dawy Dec 22 '17 at 16:18