I have buttons with the names of big cities. Clicking them, I want to get local time in them.
$(\'#btnToronto\').click(function () { var hours = ne
const now = new Date() .toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: true }) .toLowerCase();
Basically you just need to put {hour12: true} and it's done.
result => now = "21:00 pm";