Skip to content

Commit

Permalink
chore: localDate timezone 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
kkl4846 committed Aug 16, 2023
1 parent 79445ce commit 7365d48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/packman/service/FolderService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 7365d48

Please # to comment.