
--default-time-zone 옵션은 Spring Boot 애플리케이션의 기본 시간대를 설정하는 데 사용됩니다. 기본적으로, 이 옵션은 애플리케이션의 시작 시점에 설정된 시스템 시간대를 사용합니다.
--default-time-zone 옵션을 사용하여 시간대 설정을 변경하려면, 애플리케이션의 application.properties 또는 application.yml 파일에 다음 설정을 추가하세요.
#hostingforum.kr
properties
spring:
application:
name: my-app
config:
activate:
on-profile: default-time-zone
jpa:
database:
platform: h2
datasource:
url: jdbc:h2:mem:testdb
username: sa
password:
driver-class-name: org.h2.Driver
default-time-zone: Asia/Seoul
#hostingforum.kr
yml
spring:
application:
name: my-app
config:
activate:
on-profile: default-time-zone
jpa:
database:
platform: h2
datasource:
url: jdbc:h2:mem:testdb
username: sa
password:
driver-class-name: org.h2.Driver
default-time-zone: Asia/Seoul
이 설정을 사용하면, 애플리케이션의 기본 시간대가 Asia/Seoul로 설정됩니다.
--default-time-zone 옵션은 다음 경우에 유용합니다.
- 개발 환경에서 시간대가 다른 경우
- 애플리케이션의 시간대가 시스템 시간대와 다를 경우
- 시간대가 변경되어야 하는 경우
2025-03-24 01:14