• 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: Calculate minutes and seconds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculate minutes and seconds


  • Subject: Re: Calculate minutes and seconds
  • From: Graham Cox <email@hidden>
  • Date: Thu, 11 Sep 2008 11:56:04 +1000


On 11 Sep 2008, at 11:46 am, J. Todd Slack wrote:

Hi All,

Does anyone have an example of deciding when you have more than 60 seconds you have minutes and seconds? (hh:mm:ss)

Example: 65 seconds should be 00:01:05


if( seconds > 59 )
{
    ++minutes;
    seconds = 0;
}


or, if you can't catch every second:

minutes = seconds / 60;
seconds = seconds % 60;


hth,

Graham
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Calculate minutes and seconds (From: "J. Todd Slack" <email@hidden>)

  • Prev by Date: Calculate minutes and seconds
  • Next by Date: Re: Calculate minutes and seconds
  • Previous by thread: Calculate minutes and seconds
  • Next by thread: Re: Calculate minutes and seconds
  • Index(es):
    • Date
    • Thread