3

I am importing moment-timezone like this:

import * as moment from 'moment-timezone/moment-timezone';
Vue.prototype.moment = moment;

And I add UTC values like:

// copied from latest.json in moment-tz node_modules
moment.tz().add("Etc/UTC|UTC|0|0|");

If I try

let timezone = "UTC";
moment.utc(timestamp).tz(timezone);

Moment Timezone has no data for UTC

However, if I try

// which I am copying from the same latest.json
moment.tz().add("Europe/Athens|LMT AMT EET EEST CEST CET|-1y.Q -1y.Q -20 -30 -20 ....... 1o00|35e5");

let timezone = "Europe/Athens";
moment.utc(timestamp).tz(timezone);

It works. What am I doing wrong with the UTC?

senty
  • 12,385
  • 28
  • 130
  • 260
  • I guess this is gonna help you: https://stackoverflow.com/questions/33258908/angular-moment-moment-timezone-has-no-data-for-america-new-york – Guilherme Martin Oct 04 '19 at 23:17

0 Answers0