Timeformat other annoyances
This commit is contained in:
parent
39faaaa3f8
commit
596093e979
|
@ -21,6 +21,11 @@ public class TimeFormatter {
|
||||||
private static final Logger log =
|
private static final Logger log =
|
||||||
LoggerFactory.getLogger(TimeFormatter.class);
|
LoggerFactory.getLogger(TimeFormatter.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format time to day, hours, minutes, secs.
|
||||||
|
* @param ltime interval in milliseconds
|
||||||
|
* @return Formatted time string.
|
||||||
|
*/
|
||||||
public static String formatTime(Long ltime) {
|
public static String formatTime(Long ltime) {
|
||||||
if (ltime == null) {
|
if (ltime == null) {
|
||||||
return "";
|
return "";
|
||||||
|
@ -49,15 +54,16 @@ public class TimeFormatter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ss > 0) {
|
if (ss > 0) {
|
||||||
sb.append(dd).append("sec. ");
|
sb.append(ss).append("sec. ");
|
||||||
}
|
}
|
||||||
return sb.toString().trim();
|
return sb.toString().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
// private enum MunchUnit {
|
/**
|
||||||
// mu_NONE, mu_DAY, mu_HOUR, mu_MINUTE, mw_SECOND
|
* Regex-heavy digester of time values (optional) and units.
|
||||||
// }
|
* @author timh
|
||||||
|
* @since Jan 10, 2022
|
||||||
|
*/
|
||||||
private static class TimeMuncher {
|
private static class TimeMuncher {
|
||||||
|
|
||||||
public class MunchException extends Exception {
|
public class MunchException extends Exception {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user