|
|
@@ -198,7 +198,7 @@ public class DateUtil {
|
|
|
|
|
|
public static void main(String args[]) {
|
|
|
try {
|
|
|
- System.out.println(getCurrentMonth());
|
|
|
+ System.out.println(getMinuteDiff("2023-09-23 09:00:00", "2023-09-24 09:00:00"));
|
|
|
System.out.println(getCurrentYear());
|
|
|
} catch (ParseException e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -487,6 +487,23 @@ public class DateUtil {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
+ public static long getMinuteDiff(String startDateStr, String endDateStr) {
|
|
|
+ try {
|
|
|
+ DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ Date beginDate = df.parse(startDateStr);
|
|
|
+ Date endDate = df.parse(endDateStr);
|
|
|
+
|
|
|
+ long date = endDate.getTime() - beginDate.getTime();
|
|
|
+
|
|
|
+ long min = ((date / (60 * 1000)) );
|
|
|
+ return min;
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
//
|
|
|
public static String getTimeDiff(String create_time, String deal_time, Integer overDay, String holiday) throws ParseException {
|
|
|
|