I have a number between 1 and 7, which I want to turn into the user’s locale’s equivalent of Monday to Sunday. Can I do that and if so, how?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An
NSDateFormattercan give you the list of names:Which you can then index like any other array
[weekdays objectAtIndex:dayIdx];Be aware, however, that the first weekday may differ by locale; exactly how it may vary (along with many other things aboutNSCalendar) is not particularly well-explained in the docs.