Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

davbeck

macrumors regular
Original poster
May 16, 2008
104
0
Reno, NV
Is there a simple way to format dates like the iPhone SMS app does? That being that if a date is from the same day, show the time and if it's from the past week show the day of the week and if it's older show a date like 1/2/09.

I don't see anything like this in NSDateFormatter.
 
You will have to use the NSDate to get the current date and time and then check if it is the before the current date, if it is you can use the NSDateFormater to get only the date. Else get the time.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.