How can I convert a time zone offset abbreviation to the official time zone identifier?

(I rewrote my reply, I misunderstood the question before) Here's an example on how to convert a timeZone from the abbreviation: NSTimeZone* localTimeZone = NSTimeZone localTimeZone; NSString* localAbbreviation = localTimeZone abbreviation To transform it back from the localAbbreviation, is just a matter to re-create the timeZone: NSTimeZone* timeZoneFromAbbreviation = NStimeZone timeZoneWithAbbreviation:abbreviation; NSString* timeZoneIdentifier = timeZoneAbbreviation. Name; NSLog(@"Identifier: %@", timeZoneIdentifier); // Outputs America/Santiago for me Are you sure the abbreviation is returning "GMT-07:00"? Mine returns "CLT", not a GMT offset.

(I rewrote my reply, I misunderstood the question before). Here's an example on how to convert a timeZone from the abbreviation: NSTimeZone* localTimeZone = NSTimeZone localTimeZone; NSString* localAbbreviation = localTimeZone abbreviation; To transform it back from the localAbbreviation, is just a matter to re-create the timeZone: NSTimeZone* timeZoneFromAbbreviation = NStimeZone timeZoneWithAbbreviation:abbreviation; NSString* timeZoneIdentifier = timeZoneAbbreviation. Name; NSLog(@"Identifier: %@", timeZoneIdentifier); // Outputs America/Santiago for me.

Are you sure the abbreviation is returning "GMT-07:00"? Mine returns "CLT", not a GMT offset.

Unfortunately, this doesn't work when the value of the local time zone is expressed as a GMT offset. When call NSTimeZone’s description method I get the following: Local Time Zone (Etc/GMT+7 (GMT-07:00) offset -25200) – johnnieb Aug 30 at 19:59 Weird, it should be returning "PST", in fact, looking at the contents of the dictionary (NSLog(@"timeZone: %@", NSTimeZone abbreviationDictionary);), America/Los_Angeles is registered, yet the localTimeZone returns the wrong abbreviation... I'm gonna try changing the date on my iPhone. – Can Aug 30 at 20:14 Ok, I changed the Time Zone in my iPhone to "America/Los Angeles", and the abbreviation code works normally (Identifier: America/Los_Angeles).

Sorry, I can't replicate the issue. If it helps, my timeZoneDataVersion returns "2010o". – Can Aug 30 at 20:22 Yeah, your code should work.

However, if the abbreviation is a GMT offset like GMT-07:00, the time zone name is invalid. – johnnieb Aug 30 at 20:23.

When I call NSTimeZone’s abbreviation method it returns GMT-07:00. Then, when I use this value to lookup the time zone name or (time zone identifier) it returns nil. I need to retrieve the official time zone identifier, e.g. Therefore, how can I convert a time zone offset abbreviation (e.g. , GMT-07:00) to the official time zone identifier?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions