I need to get the abbreviation of the timezone.
For example, Moscow, Russia has the abbreviation MSK. Central European Time has the abbreviation of CET, Eastern European Summer Time has EEST, etc.
When I open the macOS settings, I can see the abbreviation clearly:
However, when I try to get the abbreviation in code, I get only the GMT offset:
import UIKit
let date = Date()
let zone = TimeZone(abbreviation: "EEST")
print(zone?.abbreviation(for: Date()))
Optional("GMT+3")
On the other hand, when I try to use the US time, I get the correct abbreviation:
import UIKit
let date = Date()
let zone = TimeZone(abbreviation: "EDT")
print(zone?.abbreviation(for: Date()))
Optional("EDT")
How can I always enforce TimeZone to give the abbreviation instead of the GMT offset? Are there any other way to always get the abbreviation, regardless of the locale, or other system settings?
My goal is to get the same string as in the macOS settings.

I've play with snippet code. Hope that helps you solve your problem.
Output: