Function: formatDate()
formatDate(
date,locale):string
Format a date in the requested locale using a MMM d, y-style pattern
(locale-specific month abbreviation and ordering).
Parameters
date
string | Date
locale
string
Returns
string
Example
formatDate(new Date(2025, 11, 9), 'en-US') // => "Dec 9, 2025"
formatDate(new Date(2025, 11, 9), 'pl-PL') // => "9 gru 2025"
formatDate('2025-12-09T12:00:00Z', 'de-DE') // => "9. Dez. 2025"