In my app I should set a label with a date (today), but the problem is that format date change in some countries; then I want to know waht’s the way to obtain information about device language or other information that say me that device is used in usa or france or italy or exc…
can you help me?
In my app I should set a label with a date (today), but the
Share
Try dateFormatFromTemplate:options:locale: in NSDateFormatter
For example, you can specify a template like “MMMM D, YYYY” and it will change the order of the terms for the locale that you specify.
UPDATE
If you want to know the language and the region, then you should try using this:
for the current language. (Languages are coded and in the order of most recently used first.)
for the region. Locale identifiers are coded (like it_IT for Italy). For a complete list of coded locales, use
[NSLocale availableLocaleIdentifiers]See the documentation for NSLocale to find out more about language and location.