Pragnesh Patel Pragnesh Patel - 1 year ago 95
iOS Question

timezoneWithAbbreviation:@"CST" return America/Chicago (CDT) value

I want to find the timezone for "Saskatoon, Saskatchewan, Canada" (Whose timezone is CST), so I am using the abbreviation CST on following method:

var timezone = NSTimeZone.init(abbreviation: "CST")


America/Chicago (CDT) offset -18000 (Daylight)

Why am I getting a value of CDT while I am passing CST?

Can anyone help me how can I get correct value using
method for CST abbreviation of "Saskatoon, Saskatchewan, Canada" ?

Answer Source

You can try initialising your NSTimeZone with location tzname (for TimeZone use this) instead of abbreviation.

For Saskatchewan it would be "Canada/East-Saskatchewan", "Canada/Saskatchewan" or "America/Regina".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download