Nikita Shytyk
Nikita Shytyk

Reputation: 398

Custom month and day of week names for NSDateFormatter

I need to set my own custom month and DOW names for NSDateFormatter in order to parse NSDate to NSString. Is it possible to set array with custom names to the date formatter?

Upvotes: 0

Views: 208

Answers (1)

rmaddy
rmaddy

Reputation: 318814

Look at the docs for NSDateFormatter. Use the setMonthSymbols: or setShortMonthSymbols: methods (and other similar methods as needed).

This will work for converting an NSDate to an NSString giving you whatever custom month names and day-of-week names you want in the result.

Upvotes: 2

Related Questions