How do I set format to match `{dateWithoutYear} at {time}`

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"

20 thoughts on “How do I set format to match `{dateWithoutYear} at {time}`”

Leave a Comment