A Little More on NSDateFormatter

A Little More on NSDateFormatter

NSDateFormatter (as mentioned previously) is tremendously handy.

Unfortunately, it is rather sparsely documented.

I’ve had the opportunity to use it in a number of different projects; however, in each one, I’ve had to use a bit of trial and effort to actually get strings to decode into a valid NSDate object.  All the while wishing for better documentation.

Today, I ran across this blog post that does a good job of consolidating format strings for NSDateFormatter in one place.  I thought about adding my own comments to this post, but I believe the original does the topic enough justice.  Check it out, then see my version of a helper function which I use in the TweetPhoto iPhone App.

If you plan on writing an iPhone interface to any of the Social Media APIs (Twitter, FriendFeed, etc.), you’re gonna wind up (at some point) needing to implement some helper function for NSDateFormatter.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s