JS bekommen Zeit in AM
var time = new Date();
console.log(
time.toLocaleString('en-US', { hour: 'numeric', hour12: true })
);
Exuberant Eel
var time = new Date();
console.log(
time.toLocaleString('en-US', { hour: 'numeric', hour12: true })
);
//this will give you date object remove the outer new Date to have
//it as string
const today = new Date(new Date().toLocaleString("en-US", {
day: '2-digit',
month: '2-digit',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: true
}));