Skip to main content
Intl.DateTimeFormat.formatToParts - Intl - Web documentation
method Intl.DateTimeFormat.formatToParts
DateTimeFormat.formatToParts(date?: Formattable | number): globalThis.Intl.DateTimeFormatPart[]
Allow locale-aware formatting of strings produced by `Intl.DateTimeFormat` formatters.

Parameters

optional
date: Formattable | number
The date to format.

Return Type

globalThis.Intl.DateTimeFormatPart[]