-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: UTC 기준 시간을 한국 시간으로 변환하는 함수 작성 * feat: 채팅 목록 페이지 한국 시간대 적용 * chore: createdAt 타입 변경 * fix: 변경된 type 적용 * feat: 채팅방 페이지 한국 시간대 적용
- Loading branch information
Showing
6 changed files
with
31 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export const convertUTCToKoreanTime = (utcTime: string | Date) => { | ||
const utcDate = new Date(utcTime); | ||
const offset = utcDate.getTimezoneOffset(); | ||
const koreanDate = new Date(utcDate.getTime() - offset * 60 * 1000); | ||
|
||
const formattedTime = `${koreanDate.getFullYear()}-${String( | ||
koreanDate.getMonth() + 1 | ||
).padStart(2, '0')}-${String(koreanDate.getDate()).padStart(2, '0')}T${String( | ||
koreanDate.getHours() | ||
).padStart(2, '0')}:${String(koreanDate.getMinutes()).padStart( | ||
2, | ||
'0' | ||
)}:${String(koreanDate.getSeconds()).padStart(2, '0')}`; | ||
|
||
return formattedTime; | ||
}; |
This file was deleted.
Oops, something went wrong.