Android 时间毫秒值 转 两位数(时:分:秒)格式(00:00:00)
程序员文章站
2022-04-03 22:26:40
...
public static String stringForTime(long timeMs){
long totalSeconds = timeMs/1000;
long seconds = totalSeconds % 60;
long minutes = (totalSeconds/60)%60;
long hours = totalSeconds/3600;
LogTools.i(TAG,"timeMs="+timeMs);
return new Formatter().format("%02d:%02d:%02d",hours,minutes,seconds).toString();
}