views:

41

answers:

2

Hi, I'm working on setting up NSDateFormatter to explain the date, and I'd like something short but more intuitive than 15/07/10. I think I've seen some formats that will say simply "Today" or "Tomorrow" or the day of the week for subsequent days of the same week. Is there a simple apple-approved way to get this type of date?

Thanks.

A: 

Ensure you set up your locale with the NSDateFormatter appropriately, and then ask for the weekdaySymbols. This will return an array with the days of the week in the locale you specify.

jer
+1  A: 

If you're targeting iOS 4 or later, you can call [yourFormatter setDoesRelativeDateFormatting:YES]. Otherwise, you'll most likely need a custom subclass. As for days of the week, what jer said.

Wevah