新增排程接口
This commit is contained in:
@@ -257,6 +257,38 @@ public class ZYTimeUtils {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* yyyy-MM-dd HH:mm:ss 转换成 yyyy-MM-dd HH:mm
|
||||
* @param time
|
||||
* @return
|
||||
*/
|
||||
public static String timeWithoutMillis(String time) {
|
||||
|
||||
if (TextUtils.isEmpty(time)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
SimpleDateFormat sourceFormat =
|
||||
new SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm:ss",
|
||||
Locale.getDefault());
|
||||
|
||||
SimpleDateFormat targetFormat =
|
||||
new SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm",
|
||||
Locale.getDefault());
|
||||
|
||||
Date date = sourceFormat.parse(time);
|
||||
|
||||
return date == null ? "" : targetFormat.format(date);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user