Tuesday, December 9, 2014 [Tweets] [Favorites]

Date Formatters, Calendars, and Locales

Mike Abdullah:

This shows that setting the formatter’s locale passes that onto the calendar too, which suggests that maybe NSDateFormatter.locale is just a convenience.

But if you try setting the calendar’s locale directly, that leaves the formatter’s locale property alone. So the formatter does have its own direct locale reference (as in my diagram above). This potentially leaves you with a formatter and calendar that reference very different locales. Would that cause nasty things to happen? Who knows!

Better documentation needed.

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment