Total Complexity | 1 |
Total Lines | 9 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package de.kleiner3.lasertag.common.util; |
||
10 | public class DurationUtils { |
||
11 | /** |
||
12 | * Converts a duration into a string of format h:mm:ss |
||
13 | * @param d The duration to convert |
||
14 | * @return The converted string |
||
15 | */ |
||
16 | public static String toString(Duration d) { |
||
17 | var s = d.getSeconds(); |
||
18 | return String.format("%d:%02d:%02d", s / 3600, (s % 3600) / 60, (s % 60)); |
||
19 | } |
||
21 |