• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: seconds into hours ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >seconds into hours ? (From: kubernan <email@hidden>)

  • Prev by Date: Re: seconds into hours ?
  • Next by Date: Re: RE What to do? (I have a simple method for doing it)
  • Previous by thread: Re: seconds into hours ?
  • Next by thread: Re: +poseAsClass and instance variables
  • Index(es):
    • Date
    • Thread