Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2017년 9월.
Intl.DateTimeFormat 은 언어에 맞는 날짜 및 시간 서식을 적용하기 위한 객체입니다.
새로운 Intl.DateTimeFormat 객체를 생성합니다.
매개변수로 제공한 로케일 목록 중, 런타임이 현재 지원하는 로케일 항목을 배열로 반환합니다.
DateTimeFormat 객체의 로케일과 서식 옵션에 맞춰 날짜를 서식화해 반환합니다.
Intl.DateTimeFormat.prototype.formatToParts()날짜 서식 문자열의 각 부분을 분해하여 토큰 객체로 만들고 Array로 반환합니다. 로케일에 따라 다른 사용자 지정 서식을 적용할 때 사용할 수 있습니다.
Intl.DateTimeFormat.prototype.resolvedOptions()DateTimeFormat 객체를 초기화할 때 할당된 로케일 및 서식 옵션의 계산 값을 나타내는 객체를 반환합니다.
Intl.DateTimeFormat.prototype.formatRange()두 개의 Dates를 받은 후, 현재 할당된 로케일과 옵션 내에서 가장 간결한 형태로 두 날짜의 범위를 나타내는 문자열을 반환합니다.
Intl.DateTimeFormat.prototype.formatRangeToParts()두 개의 Dates를 받은 후, 현재 할당된 로케일과 옵션 내에서 가장 간결한 형태로 두 날짜의 범위를 나타내는 문자열을 생성합니다. 문자열의 각 부분을 분해하여 토큰 객체로 만들고 Array로 반환합니다.
로케일을 지정하지 않고 사용하면 기본 로케일과 기본 옵션의 서식을 적용한 문자열을 반환합니다.
다음 예제는 지역화된 숫자 서식 방법을 보여줍니다. 사용자의 언어에 적합한 서식을 적용하려면 locales 매개변수로 해당 언어(필요한 경우 대체 언어까지)를 제공하는 걸 잊지 마세요.
options 매개변수를 지정하면 날짜와 시간 서식 결과를 원하는 형태로 바꿀 수 있습니다.
| ECMAScript® 2027 Internationalization API Specification # datetimeformat-objects |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.