diff --git a/src/main/java/com/cmc/suppin/global/config/MailConfig.java b/src/main/java/com/cmc/suppin/global/config/MailConfig.java index 56ea75d..d82a995 100644 --- a/src/main/java/com/cmc/suppin/global/config/MailConfig.java +++ b/src/main/java/com/cmc/suppin/global/config/MailConfig.java @@ -8,7 +8,8 @@ import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Component; -import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @Component @@ -26,8 +27,9 @@ public boolean sendMail(String toEmail, String code) { helper.setSubject("Suppin 인증번호"); // Format the current date and time - String formattedDateTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd, HH:mm")); - + String formattedDateTime = ZonedDateTime.now(ZoneId.of("Asia/Seoul")) + .format(DateTimeFormatter.ofPattern("yyyy-MM-dd, HH:mm")); + // Use StringBuilder to construct the HTML email body StringBuilder emailBody = new StringBuilder(); emailBody.append("") diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1a2c453..b593742 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,6 +1,8 @@ spring: server: port: 8080 + jackson: + time-zone: Asia/Seoul datasource: url: ${DB_URL} username: ${DB_USER}