I'm aware of packages like moment.js, but I would like to use only javascript. How can I get the current time as a string in Central US time?
I tried
let s = new Date().toLocaleString("en-US", { timeZone: "America/Chicago" });
But this returns the format as mm/dd/yyyy, hh:mm:ss
which I detest.
I would like to get the year in front. Is that possible using toLocalString
? I tried to change "en-US" to "iso" or "en-GB" but neither one will put the year in front.