Format a date string or timestamp to a human-readable format.
ISO date string, timestamp (number), or Date object
Formatting options
Formatted date string, or the original input if parsing fails
formatDate("2024-01-15T10:30:00Z");// "January 15, 2024 at 10:30 AM"formatDate("2024-01-15T10:30:00Z", { month: "short" });// "Jan 15, 2024 at 10:30 AM"formatDate("2024-01-15T10:30:00Z", { includeTime: false });// "January 15, 2024"formatDate(1705312200000);// "January 15, 2024 at 10:30 AM" Copy
formatDate("2024-01-15T10:30:00Z");// "January 15, 2024 at 10:30 AM"formatDate("2024-01-15T10:30:00Z", { month: "short" });// "Jan 15, 2024 at 10:30 AM"formatDate("2024-01-15T10:30:00Z", { includeTime: false });// "January 15, 2024"formatDate(1705312200000);// "January 15, 2024 at 10:30 AM"
Format a date string or timestamp to a human-readable format.