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

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

  1. macrumors newbie

    Joined:
    Nov 30, 2009
    #1
    HI,

    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.

    Thanks
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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

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

Share This Page