Skip to main content

Simple way to get the client client's time zone in JavaScript.

var nowStr = new Date(new Date().getTime()).toString(); // >>> "Sat Aug 24 2019 08:25:22 GMT-0500 (Central Daylight Time)" or "Sat Aug 24 2019 08:25:22 GMT-0500 (CDT)" (depending on Browser)
var reMatchTimeZone = nowStr.match(/\((.+)\)$/); // Extract the time zone part... or the text within parenthesis
if (reMatchTimeZone.length === 2) {
    console.log(reMatchTimeZone[1]); // >>> "Central Daylight Time", or "CDT" (depending on Browser)
} else {
    console.log("unknown");
}