2

我正在像这样导入时刻时区:

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

我添加了 UTC 值,例如:

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

如果我尝试

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

Moment Timezone 没有 UTC 数据

但是,如果我尝试

// 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);

有用。我在UTC做错了什么?

4

0 回答 0