From 4ded4d64d7c235261d9f3c07998b9a923eb66e84 Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Mon, 13 Mar 2023 18:18:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/com/tenlion/util/IdCardVerifyUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/com/tenlion/util/IdCardVerifyUtil.java b/src/main/java/cn/com/tenlion/util/IdCardVerifyUtil.java index eee573c..979382e 100644 --- a/src/main/java/cn/com/tenlion/util/IdCardVerifyUtil.java +++ b/src/main/java/cn/com/tenlion/util/IdCardVerifyUtil.java @@ -6,6 +6,7 @@ import net.sf.jsqlparser.expression.DateTimeLiteralExpression; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.Days; +import org.joda.time.LocalDateTime; import org.joda.time.Years; import org.joda.time.format.DateTimeFormat; @@ -601,8 +602,8 @@ public class IdCardVerifyUtil { public static Integer getIdCardAge(String cardNo) { String birthday = getIdCardBirthday(cardNo); - DateTime nowDateTime = DateTime.now(); - DateTime birthdayDateTime = DateTime.parse(birthday, DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD)); + LocalDateTime nowDateTime = LocalDateTime.now(); + LocalDateTime birthdayDateTime = LocalDateTime.parse(birthday, DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD)); return Years.yearsBetween(birthdayDateTime, nowDateTime).getYears(); }