/** * 将毫秒转时分秒 * * @param time * @return */ public static String generateTime(long time) { int totalSeconds = (int) (time / 1000); int seconds = totalSeconds % 60; int minutes = (totalSeconds / 60) % 60; int hours = totalSeconds / 3600; return hours > 0 ? String.format("%02dh%02dm%02ds", hours, minutes, seconds) : String.format("%02dm%02ds", minutes, seconds); }
Android将毫秒转为时分秒
最新推荐文章于 2024-08-25 03:26:23 发布
