From 80886c2decdbd9a278719436ae9ddb57a95bff66 Mon Sep 17 00:00:00 2001 From: zcl <9928619+zhangcl1991@user.noreply.gitee.com> Date: Mon, 18 Apr 2022 08:53:20 +0000 Subject: [PATCH] =?UTF-8?q?update=20austin-handler/src/main/java/com/java3?= =?UTF-8?q?y/austin/handler/shield/impl/ShieldServiceImpl.java.=20?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E6=97=B6=E5=B0=8F=E6=97=B6=E6=95=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java3y/austin/handler/shield/impl/ShieldServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/shield/impl/ShieldServiceImpl.java b/austin-handler/src/main/java/com/java3y/austin/handler/shield/impl/ShieldServiceImpl.java index 475fd1b..402b0ac 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/shield/impl/ShieldServiceImpl.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/shield/impl/ShieldServiceImpl.java @@ -11,10 +11,10 @@ import com.java3y.austin.handler.shield.ShieldService; import com.java3y.austin.support.utils.LogUtils; import com.java3y.austin.support.utils.RedisUtils; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.time.DateFormatUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.time.LocalDateTime; import java.util.Date; import java.util.HashSet; @@ -60,7 +60,7 @@ public class ShieldServiceImpl implements ShieldService { * @return */ private boolean isNight() { - return Integer.valueOf(DateFormatUtils.format(new Date(), "HH")) < 8; + return LocalDateTime.now().getHour() < 8; }