From 7365d4876514da2a250e350594365a3ee635e30b Mon Sep 17 00:00:00 2001 From: kkl4846 Date: Wed, 16 Aug 2023 18:46:53 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20localDate=20timezone=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/packman/service/FolderService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/packman/service/FolderService.java b/src/main/java/packman/service/FolderService.java index 9fe10a83..3cfa7332 100644 --- a/src/main/java/packman/service/FolderService.java +++ b/src/main/java/packman/service/FolderService.java @@ -27,6 +27,7 @@ import packman.util.ResponseCode; import java.time.LocalDate; +import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -266,7 +267,9 @@ public RecentCreatedListResponseDto getRecentCreatedList(Long userId) { ListInFolderDto listInFolderDto = listInFolderDtos.get(0); String departureDate = listInFolderDto.getDepartureDate(); - LocalDate nowDate = LocalDate.now(); + + ZoneId koreaTimeZone = ZoneId.of("Asia/Seoul"); + LocalDate nowDate = LocalDate.now(koreaTimeZone); long remainDay = ChronoUnit.DAYS.between(nowDate, LocalDate.parse(departureDate, DateTimeFormatter.ISO_DATE));