From 0f2ac9726bece8794a4d7a551afeac08dc554bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=ED=98=B8=EB=B9=88?= Date: Fri, 31 May 2024 13:07:06 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20timezone=20=EC=84=A4=EC=A0=95=20(#105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../issuetracker/IssueTrackerApplication.java | 3 ++- .../java/com/issuetracker/TimezoneConfig.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 be/issue-tracker/src/main/java/com/issuetracker/TimezoneConfig.java diff --git a/be/issue-tracker/src/main/java/com/issuetracker/IssueTrackerApplication.java b/be/issue-tracker/src/main/java/com/issuetracker/IssueTrackerApplication.java index 602e6ba16..70270df32 100644 --- a/be/issue-tracker/src/main/java/com/issuetracker/IssueTrackerApplication.java +++ b/be/issue-tracker/src/main/java/com/issuetracker/IssueTrackerApplication.java @@ -1,12 +1,13 @@ package com.issuetracker; +import java.util.TimeZone; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class IssueTrackerApplication { - public static void main(String[] args) { + TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul")); // 타임존 설정 SpringApplication.run(IssueTrackerApplication.class, args); } diff --git a/be/issue-tracker/src/main/java/com/issuetracker/TimezoneConfig.java b/be/issue-tracker/src/main/java/com/issuetracker/TimezoneConfig.java new file mode 100644 index 000000000..784185548 --- /dev/null +++ b/be/issue-tracker/src/main/java/com/issuetracker/TimezoneConfig.java @@ -0,0 +1,16 @@ +package com.issuetracker; + +import java.util.TimeZone; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class TimezoneConfig { + + @Bean + public TimeZone timeZone() { + TimeZone defaultTimeZone = TimeZone.getTimeZone("Asia/Seoul"); + TimeZone.setDefault(defaultTimeZone); + return defaultTimeZone; + } +} \ No newline at end of file