How to Get the Timezone Name in JavaScript

Detect timezone abbreviation using JavaScript

If all else fails, you can simply create your own hashtable with the long names and abbreviations.

How to get timezone name (PDT, EST, etc.) in Javascript?

Using moment.js with the moment-timezone add-on, you can do the following. The results will be consistent regardless of browser or operating system, because the abbreviations are in the data provided by the library.

The example results are from a computer set to the US Pacific time zone:

var zone = moment.tz.guess();            // "America/Los_Angeles"
var abbr = moment.tz(zone).format("z"); // either "PST" or "PDT", depending on when run

DISCLAIMER

Time zone abbreviations are not reliable or consistent. There are many different lists of them, and there are many ambiguities, such as "CST" being for Central Standard Time, Cuba Standard Time and China Standard Time. In general, you should avoid using them, and you should never parse them.

Also, the abbreviations in moment-timezone come from the IANA TZ Database. In recent editions of this data, many "invented" abbreviations have been replaced with numerical offsets instead. For example, if your user's time zone is Asia/Vladivostok, instead of getting "VLAT" like you may have in previous versions, you will instead get "+10". This is because the abbreviation "VLAT" was originally invented by the tz database to fill the data, and is not in actual use by persons in the area. Keep in mind that abbreviations are always in English also - even in areas where other language abbreviations might be in actual use.

Display local timezone name with moment.js

According to the official moment document, you can use moment-timezone

moment.tz.guess();

For further formatting, refer to this.

Edited :

var zone_name =  moment.tz.guess();
var timezone = moment.tz(zone_name).zoneAbbr()
console.log(timezone);

Refer to this working fiddle.

How to convert time zone id to to time zone name in js or moment.js

If you are considering using plain ole JavaScript as an alternative, simply use the Intl.DateTimeFormat() to control any aspect of a date or time display.

Like this: