Search code examples
iphoneobjective-ccalendarlocale

How to detect the Device Calendar type programmatically in iPhone?


I am developing an iPhone app in which app needs to send some data to server. But the problem is that if the device calendar is non gregorian, the date style is different for the year because of which app is not able to add the data to server. Is there any method to detect the device's current calendar type?


Solution

  • You can check the device's current locale.

    [NSLocale currentLocale] [NSLocale systemLocale]

    You can also get the systems current calendar

    [NSCalendar currentCalendar]