Date Formatting

Discussion in 'iOS Programming' started by davbeck, Dec 20, 2009.

  1. davbeck macrumors regular

    May 16, 2008
    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.
  2. KoolStar macrumors demi-god


    Oct 16, 2006
    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.

Share This Page