-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
export function formatDate(isoDate: string) { | ||
const date = new Date(isoDate); | ||
const year = date.getFullYear().toString().slice(2); // 년도에서 앞 2자리만 추출 | ||
const month = String(date.getMonth() + 1).padStart(2, "0"); // 월을 2자리로 변환하고 앞에 0을 채움 | ||
const day = String(date.getDate()).padStart(2, "0"); // 일을 2자리로 변환하고 앞에 0을 채움 | ||
const hours = String(date.getHours()).padStart(2, "0"); // 시를 2자리로 변환하고 앞에 0을 채움 | ||
const minutes = String(date.getMinutes()).padStart(2, "0"); // 분을 2자리로 변환하고 앞에 0을 채움 | ||
|
||
return `${year}.${month}.${day}, ${hours}시 ${minutes}분`; | ||
} |