Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Seconds to minute and seconds conversion

807605Sep 16 2007 — edited Sep 16 2007
Say I have an int:

int time = 1500

which means that there are 1500 seconds in time and I would like to convert that to the format of

25:00

which is 25 minutes and 0 seconds

what I did so far is
System.out.println(time/60 + time%60);
and it always gives me the result of 25:0 instead of 25:00, how do I deal with this??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2007
Added on Sep 16 2007
1 comment
284 views