From f3c53c47e224881b7fbdb34d220c68c51dd4ec58 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Thu, 17 Jan 2019 13:31:42 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=96=B2=E5=8A=B3=E5=BA=A6][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E6=97=B6=E9=97=B4=E5=88=A4=E6=96=AD=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/utils/DateUtils.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/utils/DateUtils.java b/mallinkService/src/main/java/com/iformall/utils/DateUtils.java index ad1b65d2e..d7b907cbd 100755 --- a/mallinkService/src/main/java/com/iformall/utils/DateUtils.java +++ b/mallinkService/src/main/java/com/iformall/utils/DateUtils.java @@ -915,17 +915,20 @@ public class DateUtils { String strDate = sdf.format(date); // 截取当前时间时分 - int strDateH = Integer.parseInt(strDate.substring(0, 2)); - int strDateM = Integer.parseInt(strDate.substring(3, 5)); + String[] dateArr = strDate.split(":"); + int strDateH = Integer.parseInt(dateArr[0]); + int strDateM = Integer.parseInt(dateArr[1]); int strDateT = strDateH * 60 + strDateM; // 截取开始时间时分 - int strDateBeginH = Integer.parseInt(timeStart.substring(0, 2)); - int strDateBeginM = Integer.parseInt(timeStart.substring(3, 5)); + String[] startArr = timeStart.split(":"); + int strDateBeginH = Integer.parseInt(startArr[0]); + int strDateBeginM = Integer.parseInt(startArr[1]); int strDateBeginT = strDateBeginH * 60 + strDateBeginM; // 截取结束时间时分 - int strDateEndH = Integer.parseInt(timeEnd.substring(0, 2)); - int strDateEndM = Integer.parseInt(timeEnd.substring(3, 5)); + String[] endArr = timeEnd.split(":"); + int strDateEndH = Integer.parseInt(endArr[0]); + int strDateEndM = Integer.parseInt(endArr[1]); int strDateEndT = strDateEndH * 60 + strDateEndM;