View Single Post
Old 01-28-2005, 11:34 AM   #4 (permalink)
Iron_Cross
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

you use the modulo operator %.
Convert it to minutes first, then use the modulo operator to convert to hours and minutes:
Code:
int seconds = 7300;
int minutes = 0;
int hours = 0;

// start calculation
minutes = seconds/60;
hours = minutes/60;
minutes = minutes%60;
I'm getting 2hr 1min btw. Then you just use a printf() to print the values.
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline