Jump to content
  • Advertisement
Sign in to follow this  
PureSnowX

[Remove]

This topic is 2643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
if you are 10 years old this is a very legitimate question.. or maybe I am not really understanding the question?

Are you really asking how to convert seconds to minutes?

blink.gif

Share this post


Link to post
Share on other sites
As above but...


hours * 60 = minutes
minutes * 60 = seconds

// so

hours * 60 * 60 = seconds1
minutes * 60 = seconds2
seconds = seconds3

seconds1 + seconds2 + seconds3 = startTime

// now repeat the process to get the end time in seconds
// Then

endTime - startTime = duration

// Convert back

duration / 60 = hours
duration % 60 = remaining (% gets the remainder of duration / 60)
remaining / 60 = minutes
duration % 60 = remaining
remaining = seconds



Easy enough huh?

Share this post


Link to post
Share on other sites
Another option is to do it how you would in your head. When subtracting times in your head, you don't convert everything to seconds. You subtract each "component", and use a carry.

Share this post


Link to post
Share on other sites
Please don't redact your questions like that. It is a breach of netiquette, to say nothing of the forum rules.

Share this post


Link to post
Share on other sites

This topic is 2643 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!