时间问题修复

This commit is contained in:
wangshilong 2025-01-03 10:03:57 +08:00
parent 0e404b28b4
commit e55fde5a05
1 changed files with 2 additions and 2 deletions

View File

@ -74,8 +74,8 @@ public interface Timing {
}
String[] items = StringUtils.split(stringTime, ":");
int hours = Integer.parseInt(items[0]);
int minutes = items.length >= 2 ? 0 : Integer.parseInt(items[1]);
int seconds = items.length >= 3 ? 0 : Integer.parseInt(items[2]);
int minutes = items.length >= 2 ? Integer.parseInt(items[1]) : 0;
int seconds = items.length >= 3 ? Integer.parseInt(items[2]) : 0;
return StringUtils.leftPad(Integer.toHexString(hours), 4, "0") +
StringUtils.leftPad(Integer.toHexString(minutes), 4, "0") +
StringUtils.leftPad(Integer.toHexString(seconds), 4, "0");