時間を表す一連の数字を解釈して、近い将来それらを別の数字に変更できるようにしようとしています。135671800はどのくらいですか? そして、それぞれはどういう意味ですか?DD:HH:MM:SSですか?
{"next_timestamp":1356751800,"next_duration":9000,"next_title":"Saturday Night","next_description":"Hearing and Healing"}
結果を解釈している元の JavaScript は次のとおりです。
else if (typeof data.next_timestamp !== "undefined") {
seconds_till = data.next_timestamp - (new Date().getTime() / 1000);
days = Math.floor((seconds_till % 31536000) / 86400);
hours = Math.floor((seconds_till % 86400) / 3600);
minutes = Math.floor((seconds_till % 3600) / 60);
seconds = Math.floor(seconds_till % 60);
return intervalId = setInterval(function() {
if (--seconds < 0) {
seconds = 59;
if (--minutes < 0) {
minutes = 59;
if (--hours < 0) {
hours = 23;
if (--days < 0) {
days = 365;
}
}
}
}
ありがとう!