Regarding your code:
You should not use time zone abbreviations like
EST
for this purpose, since time zone abbreviations are often ambiguous. If you're looking to set US Eastern Time, then you should be using the IANA time zone identifier ofAmerica/New_York
.EST
only exists in the tzdb for backwards compatibility purposes. Arguably, it should be left out of the moment-timezone data.Calling
moment.tz()
without any argument is not recommended. You should just callmoment()
.Your code appears to be formatting a moment, then parsing it into another moment, then formatting it out again. There's no reason to jump through so many hoops.
You should not use the
_d
property. That is meant to be internal to moment.js. (It should probably be hidden by closure, but it's not). Instead, use.format()
or one of the other public functions.
Ultimately, I think you are simply after:
var now = moment().tz('America/New_York').format("MM/DD/YYYY hh:mm");
I highly suggest you re-read the moment-timezone and moment.js documentation.
Regarding the moment-timezone web site with the map - you're correct that there's currently a bug with the demonstration web site. It is not a bug with the library itself. I'll investigate and report that to the moment team.