There is a script to get the current time and it should be updated every second. It does not work.
Can you tell me how to optimize it to make it work and display the result on the page so it shows the time online.
`export default {
wr: async () => {
const date = new Date();
const options = {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
hour12: true,
timeZone: 'America/Nassau',
};
// US English uses month-day-year order
let a = new Intl.DateTimeFormat('en-US', options).format(date);
// "1/12/2023, 09:13:57"
return setInterval(()=> {a}, 1000);
}
}`