新增排程接口
This commit is contained in:
@@ -229,10 +229,38 @@ public class ZYTimeUtils {
|
||||
public static String getStrTimeData(Date date) {
|
||||
String timeString = null;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
timeString = sdf.format(new Date());//单位秒
|
||||
timeString = sdf.format(date);//单位秒
|
||||
return timeString;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* yyyy-MM-dd HH:mm 转换为 HH:mm显示
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String yyyyMMdd2HH_mm(String date) {
|
||||
if (TextUtils.isEmpty(date)) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
SimpleDateFormat sourceFormat =
|
||||
new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault());
|
||||
|
||||
SimpleDateFormat targetFormat =
|
||||
new SimpleDateFormat("HH:mm", Locale.getDefault());
|
||||
|
||||
Date parseDate = sourceFormat.parse(date);
|
||||
|
||||
return parseDate == null ? "" : targetFormat.format(parseDate);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getStrTimeData_H_M(Date date) {
|
||||
String timeString = null;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
|
||||
|
||||
Reference in New Issue
Block a user