Using Intl.DateTimeFormat I can get the word 'at' between the date and time using dateStyle
and timeStyle
as shown below. Is it possible to get the exact same output but without the year - "December 20 at 2:23 PM"?
date = new Date(Date.UTC(2020, 11, 20, 3, 23, 16, 738));
new Intl.DateTimeFormat('en-US', { dateStyle: 'long', timeStyle: 'short' }).format(date);
=> "December 20, 2020 at 2:23 PM"
Clarification edit: This needs to work across all locales "at" just being the English version.
This question is not a duplicate of How to format a JavaScript date or any other ones as it is asking how to achieve a specific formatting not discussed there.