How do you display a JavaScript datetime object in the 12 hour format (AM/PM)?
As far as I know, the best way to achieve that without extensions and complex coding is like this:
date.toLocaleString([], { hour12: true});
Javascript AM/PM Format
Click the button to display the date and time as a string.
I found this checking this question out.
How do I use .toLocaleTimeString() without displaying seconds?