public static String getTime(Long time) { String timeStr=""; if (time==null){ return null; } //时 Long hour = time / 60 / 60; //分 Long minutes = time / 60 % 60; //秒 Long remainingSeconds = time % 60; //判断时分秒是否小于10…… if (hour < 10){ timeStr = minutes + "分" + remainingSeconds+"秒"; }else if (minutes < 10){ timeStr = minutes + "分" + remainingSeconds+"秒"; }else if (remainingSeconds < 10){ timeStr = minutes + "分" + "0" + remainingSeconds+"秒"; }else { timeStr = minutes + "分" + remainingSeconds+"秒"; } return timeStr; }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)