user3517855
user3517855

Reputation: 211

How to get daylight saving settings programmatically in Xcode?

Some countries are observing daylight saving, so I want to know if daylight setting is currently turned on or off (TRUE or FALSE) on the iDevice then I could correct the date on my app. is that possible?

Upvotes: 0

Views: 1703

Answers (1)

Rich
Rich

Reputation: 8202

Query the current NSCalendars timeZone to see if it is currently in daylight saving time.

BOOL dst = [[[NSCalendar currentCalendar] timeZone] isDaylightSavingTime];

Upvotes: 4

Related Questions