Timezone support value - objective-c - cocoa -touch

I searched for some time and did a lot of research, and also experimented, but I can’t find a way to get the value stored in the user settings for supporting time zones on iOS devices.

I looked at the convenient methods NSTimeZone + systemTimeZone, + resetSystemTimeZone, + defaultTimeZone, + localTimeZone. I even fully understand the differences between the two and how we can set our own default time zone for each application and how the first default call returns a value for the system. The system is then cached and should be reset if the device changes the time zones.

The problem is that systemTimeZone is always located where the device is located, and not the value set in the device settings in the Support for time zones section.

I even look at [[NSCalendar currentCalendar] timeZone], as well as [[NSCalendar autoupdatingCurrentCalendar] timeZone]].

I even tried [[[NSLocale currentLocale] objectForKey: NSCurrentCalendar] timeZone] and [[[NSLocale autoupdatingCurrentLocale] objectForKey: NSCurrentCalendar] timeZone]

Nothing returns the value of the device Settings.app → Mail, Contacts, Calendars → Support for time zones → Time zone.

Does anyone know how to get the value of Settings.app -> Mail, Contacts, Calendars -> Time Zone Support -> Set Time Zone?

Thanks and greetings!

+4
source share
1 answer

Excuse me if this is not the case, but are you sure you really want to access the time zone support setting from the following location?

  • Settings.app → Mail, Contacts, Calendars → Time Zone Support

I would not have made this message differently, but you made me think when you stated the following:

The problem is that systemTimeZone is always located where the device is located, and not the value set in the device settings in the Support for time zones section.

Unfortunately, your statement here is not entirely correct. +systemTimeZone will return the time zone where the actual location of the device is , unless the user has turned it off. Set automatically and selected a specific time zone in the following location:

  • Settings.app → General → Date and Time

This will change the time zone that will be used in the system-wide mode, which is immediately reflected by the time in the status bar, which sets up for the new setting.

What you tried to access earlier seems to focus on how calendar appointments are presented in your own Calendar.app, and will seem to be closed to this application (along with the rest of the settings in this area).

If you are looking for access to an effective time zone setting for the entire system, which can be changed by the user, then the time zone by date and time is the way to go. This will be the value returned by +systemTimeZone .

On the other hand, if you really need to access the time zone support settings in the Mail, Contacts, Calendars sections, I’m afraid that I can’t help you, and I apologize for the distraction.

+2
source

All Articles