How To Display Time Until A certain Date in iPhone Programming?

Discussion in 'iOS Programming' started by Alanclark, Nov 30, 2009.

  1. macrumors newbie

    Nov 30, 2009

    I was wondering if you someone could help me with somehow showing the exact time (months, days, minutes, even seconds) until an exact date in a text label in iPhone programming.

    I'm hoping that when the app is launched, it shows in a label the amount of time from the minute it is opened until a certain date, and it displays in days, hours, minutes, and seconds..

    Please include the code...or sample code.

  2. Moderator emeritus


    Jul 24, 2002
    I'm not including code: you'll just copy and paste it and learn the square root of f-all. You need to look at NSDate timeIntervalSinceDate:. This will return an NSTimeInterval (which is in seconds). You should be able to work out how to format that as a string by dividing down to get each component you want.
  3. macrumors regular

    Aug 6, 2009
    Hi will you write my program for me? Please include Source Files thanks! lol

Share This Page