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

Alanclark

macrumors newbie
Original poster
Nov 30, 2009
2
0
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
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.