Skip to content

Date API

changeDateFormat(str: string, format: string, locale: string)

텍스트를 날짜 포맷으로 변경해주는 함수.
기본 포멧은 YYYY-MM-DD 입니다. 기본 언어 설정은 en 입니다.

Example

Input

ts
const _date = '2024-12-25';
console.dir(changeDateFormat(_date, 'YYYY-MM-DD HH:mm:ss dddd', 'ko'));

Output

text
"2024-12-25 00:00:00 수요일"