0
我倒數日食使用jquery countdown.js。我的桌面上的一切都正確計數。在移動設備(android)上,倒計時提前一個小時。在其他人的手機上,倒計時顯示0小時。我究竟做錯了什麼?我沒有考慮時區嗎?應該這樣嗎?倒計時是對月食(從現在開始不到4小時),所以我可以很快使用幫助!javascripts/jquery倒計時在手機上給出錯誤的小時數
var date = new Date("2017-08-21T13:18:00"); //1:18 p.m. EST
$("#dayElem")
.countdown(date, function(event) {
if (event.strftime('%-D') < 10) {
$(this).text('0' +
event.strftime('%-D')
);
} else {
$(this).text(
event.strftime('%-D')
);
}
});
$("#hourElem")
.countdown(date, function(event) {
if (event.strftime('%-H') < 10) {
$(this).text('0' +
event.strftime('%-H')
);
} else {
$(this).text(
event.strftime('%-H')
);
}
});
$("#minuteElem")
.countdown(date, function(event) {
if (event.strftime('%-M') < 10) {
$(this).text('0' +
event.strftime('%-M')
);
} else {
$(this).text(
event.strftime('%-M')
);
}
});
$("#secondElem")
.countdown(date, function(event) {
if (event.strftime('%-S') < 10) {
$(this).text('0' +
event.strftime('%-S')
);
} else {
$(this).text(
event.strftime('%-S')
);
}
});