Javascript 将多实例计时器扩展为时区感知

Javascript 将多实例计时器扩展为时区感知,javascript,timer,Javascript,Timer,我有一个js计时器,用于显示拍卖格式出售的物品的结束时间倒计时。下面是我使用的js $('[data-countdown]').each(function() { var $this = $(this), finalDate = $(this).data('countdown'); $this.countdown(finalDate, function(event) { $this.html(event.strftime('%-Dday%!D %-Hhr%!H %Mmin%!M %Ssec'))

我有一个js计时器,用于显示拍卖格式出售的物品的结束时间倒计时。下面是我使用的js

$('[data-countdown]').each(function() {
var $this = $(this), finalDate = $(this).data('countdown');
$this.countdown(finalDate, function(event) {
$this.html(event.strftime('%-Dday%!D %-Hhr%!H %Mmin%!M %Ssec'));
});
});
我想知道这个时区,所以我在网上搜索了MomentJS。 我已经包含了moment-with-locales.min.js和moment-timezone-with-data-2010-2020.min.js文件,它们正在正确加载

我真的很难理解如何将js集成到我当前的脚本中,因为github上的示例只针对单个实例计时器。 他们给出的代码示例是

var nextYear = moment.tz("2015-01-01 00:00", "America/Sao_Paulo");
$('#clock').countdown(nextYear.toDate(), function(event) {
$(this).html(event.strftime('%D days %H:%M:%S'));
});
现在我假设我需要应用

= moment.tz("2015-01-01 00:00", "America/Sao_Paulo");
键入日期的代码,这些代码存储在数据倒计时中,但我只是在倒计时应该在的地方留下一个空格

这就是我试图做的

var $this = $(this), finalDate = moment.tz($(this).data('countdown'), "America/Sao_Paulo");

添加moment.tz命令时哪里出错了?

我使用

$('[data-countdown]').each(function() {
var $this = $(this), finalDate = moment.tz($(this).data('countdown'), "Europe/London");
$this.countdown(finalDate.toDate(), function(event) {
$this.html(event.strftime('%-Dday%!D %-Hhr%!H %Mmin%!M %Ssec'));
});
});
我唯一的问题是时间是1小时。伦敦15:00的结束时间在巴黎应该还有一个小时的倒计时,但现在还有两个小时