Olof
Olof

Reputation: 5338

Localize the literal "today"

Is it possible to localize the literal "today" in objective c/cocoa touch? That is when I display "today" a english iphone would get "today", a german would get "heute" and so forth.

Similar to the automatic handling of "monday", "tuesday" and so forth in NSDateFormatter.

Upvotes: 1

Views: 824

Answers (1)

Olof
Olof

Reputation: 5338

The solution came from the comment by user aBitObvious.

And as aBitObvious said, it is to use the method setDoesRelativeDateFormatting: in NSDateFormatter. There is an example in the docs .

Upvotes: 1

Related Questions