I'm having trouble displaying timezones correctly using moment.js.
I attempted to use the following code:
var result = moment(someDate).format("MM/DD/YYYY HH:mm A Z");
This returns something like: 08/05/2015 06:18 PM +02:00
, which is okay, but I would prefer my output to be more like 08/05/2015 06:18 PM WEDT
or similar, including timezone abbreviations.
I tried using this code, but it doesn't seem to show the timezone properly:
var result = moment(someDate).format("MM/DD/YYYY HH:mm A z");
or
var result = moment(someDate).format("MM/DD/YYYY HH:mm A zz");
UPDATE
Following @Matt Johnson's advice, I utilized this method to display the timezone using moment-timezone-with-data.js and tzdetect.js:
var tzName = tzdetect.matches()[0];
var result = moment.tz(myDate, tzName).format("MM/DD/YYYY h:mm A zz");