A string representing the date.
Optional
formatter: stringOptional. A specific format string to format the date. Defaults to 'YYYY-MM-DD HH:mm:ss'.
The formatted date string.
Throws an error if the date string is invalid or cannot be parsed into a Date object.
const dateString = '2024-02-19T10:30:00Z';
const formattedDateTime = formatDateTimeByString(dateString, 'MMMM D, YYYY, h:mm A');
console.log(formattedDateTime);
Formats a date string into a specified date time format