Re: seconds into hours ?
Re: seconds into hours ?
- Subject: Re: seconds into hours ?
- From: Don Murta <email@hidden>
- Date: Fri, 22 Feb 2002 14:30:46 -0700
On Friday, February 22, 2002, at 01:34 PM, kubernan wrote:
I'm looking for the best way to translate seconds into hours such as :
Maybe not the best way, but it should work. Just decompose the time
like you would
ints into a string (using divs & mods to pull out the digits).
don
using sec as your seeded time in seconds
seconds = sec % 60;
sec = sec / 60;
minutes = sec % 60;
sec = sec / 60;
hours = sec;
// or do hours = sec % 24 and days = sec / 24;
aTimeString = [NSString stringWithFormat:@"%d : %d : %d", hours,
minutes, seconds];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.