This commit is contained in:
18401019693
2022-07-26 10:06:16 +08:00
parent 8a9083f9b5
commit 8280e43a46
2 changed files with 22 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
package com.yunbao.common.utils;
/**
* 时间处理
*/
public class TimeUtils {
/**
* 毫秒转秒
* @param duration 毫秒数
* @return
*/
public static long durationToSecond(long duration) {
long toSecond = 0;
long seconds = duration % 60000;
long second = Math.round((float) seconds / 1000);
long minute = duration / 60000;
toSecond = ((minute * 60) + second);
return toSecond;
}
}