Skip to content

refactor: 채팅 전송 시 현재 시간 보다 늦은 시간으로 기록되는 문제 수정#221

Merged
JanooGwan merged 2 commits intodevelopfrom
fix/chat-message-sendtime
Feb 14, 2026
Merged

refactor: 채팅 전송 시 현재 시간 보다 늦은 시간으로 기록되는 문제 수정#221
JanooGwan merged 2 commits intodevelopfrom
fix/chat-message-sendtime

Conversation

@JanooGwan
Copy link
Copy Markdown
Contributor

🔍 개요

  • 채팅 전송 시 현재 시간보다 늦은 시간으로 전송 시간이 기록되는 문제를 해결했습니다.
  • close #이슈번호

🚀 주요 변경 내용

  • 기존에 채팅을 전송하면 원래 시간보다 9시간 늦은 시간으로 전송 시간이 기록 됐었는데, 이것을 현재 시간으로 올바르게 기록될 수 있도록 수정했습니다.

💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@JanooGwan JanooGwan requested a review from Copilot February 14, 2026 14:22
@JanooGwan JanooGwan self-assigned this Feb 14, 2026
@JanooGwan JanooGwan added the 버그 정상적으로 동작하지 않는 문제 상황 관련 이슈입니다. label Feb 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

채팅 전송 시간(전송 시각)이 현재 시간 대비 9시간 늦게 기록되는 문제를 해결하기 위해, 애플리케이션 구동 시 JVM 기본 타임존을 Asia/Seoul로 고정하는 변경입니다.

Changes:

  • 애플리케이션 시작 시 기본 타임존을 Asia/Seoul로 설정하는 초기화 로직 추가

Comment on lines +23 to +26
@PostConstruct
public void init() {
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
}
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PostConstruct에서 TimeZone.setDefault(...)로 JVM 기본 타임존을 런타임에 변경하면, 이미 초기화된 컴포넌트(예: Jackson/ Hibernate/ 스케줄러)가 기존 기본 타임존을 기준으로 동작을 고정해버릴 수 있어 환경에 따라 여전히 시간 오프셋이 남거나, 반대로 다른 도메인 시간 로직이 한꺼번에 바뀌는 부작용이 생길 수 있습니다. 이 설정이 필요하다면 (1) main에서 SpringApplication.run 호출 전에 기본 타임존을 설정하거나 (2) -Duser.timezone/spring.jackson.time-zone/spring.jpa.properties.hibernate.jdbc.time_zone처럼 설정 기반으로 명시해 영향 범위를 통제하는 쪽이 더 안전합니다. 또한 타임존 값은 하드코딩 대신 설정 값으로 빼 두는 편이 운영/테스트 환경 분리에 유리합니다.

Copilot uses AI. Check for mistakes.
@JanooGwan JanooGwan merged commit 737ba4c into develop Feb 14, 2026
1 check passed
@dh2906 dh2906 deleted the fix/chat-message-sendtime branch February 17, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 정상적으로 동작하지 않는 문제 상황 관련 이슈입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants