const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
console.log(timezone);
// current datetime string in America/Chicago timezone
let chicago_datetime_str = new Date().toLocaleString("en-US", { timeZone: "America/Chicago" });
// create new Date object
let date_chicago = new Date(chicago_datetime_str);
// how to get current time zone in javascript
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
console.log(timezone); // Asia/Calcutta
document.getElementById("time").innerHTML = Date().slice(Date().indexOf("(")+1,Date().lastIndexOf(")"));
' check time zone
DateDiff("s", "01/01/1970 00:00:00", Now())