Formats a date according to the specified dateStyle and locale.
dateStyle
Uses Intl.DateTimeFormat internally.
Intl.DateTimeFormat
"short"
dd/mm/yyyy
31/12/2025
Intl
formatDate(new Date("2025-12-31"), { dateStyle: "short" }); // "31/12/2025"formatDate(new Date("2025-12-31"), { dateStyle: "medium" }); // "Dec 31, 2025"formatDate(new Date("2025-12-31"), { dateStyle: "long" }); // "December 31, 2025"formatDate(new Date("2025-12-31"), { dateStyle: "full" }); // "Wednesday, December 31, 2025" Copy
formatDate(new Date("2025-12-31"), { dateStyle: "short" }); // "31/12/2025"formatDate(new Date("2025-12-31"), { dateStyle: "medium" }); // "Dec 31, 2025"formatDate(new Date("2025-12-31"), { dateStyle: "long" }); // "December 31, 2025"formatDate(new Date("2025-12-31"), { dateStyle: "full" }); // "Wednesday, December 31, 2025"
Optional
The date object or timestamp to format.
Options to customize formatting.
A formatted date string.
Formats a date according to the specified
dateStyleand locale.Uses
Intl.DateTimeFormatinternally."short"uses a custom format:dd/mm/yyyy(e.g.,31/12/2025)IntlformattingExample Output