mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update
This commit is contained in:
@@ -1184,4 +1184,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
return halfYearAgo.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将HH:mm格式的时间字符串转换为yyyy-MM-dd HH:mm:ss格式的时间字符串
|
||||
* @param timeStr
|
||||
* @return
|
||||
*/
|
||||
public static String formatTime(String timeStr) {
|
||||
return LocalDateTime.of(
|
||||
LocalDate.now(),
|
||||
LocalTime.parse(timeStr, DateTimeFormatter.ofPattern("HH:mm")).withSecond(0)
|
||||
).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user