Here you can find the source of convertTime(long x)
Parameter | Description |
---|---|
x | The time to be formatted, in milliseconds (as a long). |
public static String convertTime(long x)
//package com.java2s; //License from project: Open Source License public class Main { /** /*from w w w.j a v a2s . c o m*/ * Takes a time in milliseconds and converts to a string to be printed. * * @param x The time to be formatted, in milliseconds (as a long). * @return A string to be printed. */ public static String convertTime(long x) { x /= 1000; return String.format("%dh%02dm%02ds", x / 3600, (x / 60) % 60, x % 60); } }