我正在使用moment-timezone lib。我的问题是,在计算偏移量时,它似乎并不关心夏时制偏移。 示例:
//This date is in August when Warsaw is +2 vs UTC
const w = momentTz.tz([2018, 7, 31, 12, 15, 45, 500], 'Europe/Warsaw');
const timestamp = w.unix();
const offset= momentTz.tz.zone('Europe/Warsaw').utcOffset(timestamp);
//Prints '-60', while the real offset is '-120'
console.log(offset);