How to get daylight saving settings programmatically in Xcode?

限于喜欢 提交于 2019-12-25 01:48:15

问题


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?


回答1:


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

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


来源:https://stackoverflow.com/questions/23152954/how-to-get-daylight-saving-settings-programmatically-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!