Possible Duplicate:
How to convert Milliseconds to “X mins, x seconds” in Java?
Hello I need convert in JSP file long value that show number of milliseconds to format mm:ss
<td>${values.parameters.timeLong}</td>
Possible Duplicate:
How to convert Milliseconds to “X mins, x seconds” in Java?
Hello I need convert in JSP file long value that show number of milliseconds to format mm:ss
<td>${values.parameters.timeLong}</td>
A simple solution is to use SimpleDateFormat (with a format of "mm.ss"
). I would perhaps do this on the server and provide the JSP with a pre-rendered value.
Beware that this class isn't thread-safe and a better alternative is available via Joda-Time
Too bad.. its too easy..
x = input/ 1000;
minutes = x % 60;
seconds = x - ( minutes * 60 )
This will be faster than using SimpleDateFormat