提交 | 用户 | 时间
|
1ac2bc
|
1 |
package cn.stylefeng.guns.workflow.core.util; |
懒 |
2 |
|
|
3 |
/** |
|
4 |
* 时间计算工具类 |
|
5 |
* |
|
6 |
* @author fengshuonan |
|
7 |
* @Date 2019/8/7 23:14 |
|
8 |
*/ |
|
9 |
public class TimeCalcUtil { |
|
10 |
|
|
11 |
/** |
|
12 |
* 根据耗时的毫秒数计算天时分秒 |
|
13 |
* |
|
14 |
* @author fengshuonan |
|
15 |
* @Date 2019-08-28 14:41 |
|
16 |
*/ |
|
17 |
public static String calc(Long millisSeconds) { |
|
18 |
long tian = millisSeconds / (1000 * 60 * 60 * 24); |
|
19 |
long shi = (millisSeconds % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60); |
|
20 |
long fen = (millisSeconds % (1000 * 60 * 60 * 24)) % (1000 * 60 * 60) / (1000 * 60); |
|
21 |
long miao = (millisSeconds % (1000 * 60 * 60 * 24)) % (1000 * 60 * 60) % (1000 * 60) / 1000; |
|
22 |
return tian + "天" + shi + "时" + fen + "分" + miao + "秒"; |
|
23 |
} |
|
24 |
|
|
25 |
} |