排程详情

This commit is contained in:
fengjignqi
2026-05-26 14:25:41 +08:00
parent 1ed3a68a5e
commit 5ca81f565a
12 changed files with 212 additions and 36 deletions

View File

@@ -293,6 +293,34 @@ public class ZYTimeUtils {
return "";
}
/**
* HH:mm:ss 转 HH:mm
* 例如:
* 08:00:00 -> 08:00
* 18:35:29 -> 18:35
*/
public static String formatHHmm(String time) {
if (TextUtils.isEmpty(time)) {
return "";
}
try {
SimpleDateFormat sourceFormat =
new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
SimpleDateFormat targetFormat =
new SimpleDateFormat("HH:mm", Locale.getDefault());
Date date = sourceFormat.parse(time);
return targetFormat.format(date);
} catch (Exception e) {
e.printStackTrace();
return time;
}
}
public static String getStrTimeData_H_M(Date date) {
String timeString = null;
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");