Answer the question
In order to leave comments, you need to log in
How to set the time zone MSK?
From the base I get the time and the site should have a timer, for some reason it shows differently on different ip, how to set the time zone MSC?
Here is the script
function timeGet(date, ints){
let now = new Date().getTime();
// Find the distance between now an the count down date
let distance = ints - now;
// Time calculations for days, hours, minutes and seconds
let days = Math.floor(distance / (1000 * 60 * 60 * 24));
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="demo"
date.text(hours + ":" + minutes + ":" + seconds);
// If the count down is over, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById("demo").innerHTML = "EXPIRED";
} else {
setTimeout(function(){ timeGet(date, ints); }, 1000);
}
}
Answer the question
In order to leave comments, you need to log in
using Date.UTC
new Date(Date.UTC(year, month, day, hour, minute, second));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question