Re: Calculate minutes and seconds
Re: Calculate minutes and seconds
- Subject: Re: Calculate minutes and seconds
- From: "J. Todd Slack" <email@hidden>
- Date: Wed, 10 Sep 2008 19:22:23 -0700
Graham,
This is a good idea, I forgot about using the mod operation.
-Jason
On Sep 10, 2008, at 7:02 PM, Graham Cox wrote:
On 11 Sep 2008, at 11:46 am, J. Todd Slack wrote:
Example: 65 seconds should be 00:01:05
If your question was about how to create this (as a string, say)
from a number of seconds, try:
int hours, minutes, seconds;
hours = rawSeconds / 3600;
minutes = (rawSeconds / 60) % 60;
seconds = rawSeconds % 60;
NSString* hmsStr = [NSString stringWithFormat:@"%0.2d:%0.2d:%0.2d",
hours, minutes, seconds];
G.
_______________________________________________
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