Hello! Tell me how to rearrange this timer at the time of UTC msk and not the current one on the computer.
var finaltime = Math.floor((new Date(2016,5,28,24,0,0)).getTime()/1000); var timerId = window.setInterval( display, 100); var el = document.getElementById("seconds"); var date = new Date; function display() { var seconds = Math.floor((finaltime - (new Date()).getTime()/1000)) ,minutes ,hours ,days ; //date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds() if (seconds <= 0) { window.clearInterval( timerId); $.ajax({ type: 'POST', url: 'response.php?', data: 'name=Andrew', success: function(data) { $('#show').html(data); } }); return; } days = Math.floor(seconds/86400); seconds = seconds % 86400; hours = zeropad( Math.floor( seconds / 3600)); seconds = seconds % 3600; minutes = zeropad( Math.floor( seconds / 60)); seconds = zeropad( seconds % 60); el.innerHTML = days + ' дней ' + hours + ":" + minutes + ":" + seconds; } function zeropad(n) { return n < 10 ? '0'+n : n.toString(); } <b id="seconds">0</b> <div id="show"></div>
var seconds = Math.floor((finaltime - (new Date(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds())).getTime()/1000))but the timer just stands. - Bogdan