How to specify Moscow time or server time in request auto-sending using JS?

  • 0
    At that time, I wrote a JS code that automatically clicks the button after 60 seconds from the moment it was launched.
    setTimeout(() => {
    }, 60000);

    As far as I understand, the time here goes from the time that is installed on my computer, on which the browser is running. Tell me, how can I specify server time instead, or Moscow time? You just need super high accuracy. If you need to redo the code for this, please tell me how to write it. I do not understand programming and wrote all this, collecting pieces of information from various forums. I can't go further.
    Thank you all for your help.
    JavaScript Anonymous, Feb 3, 2020

  • 2 Answers
  • 0
    What is Ultra High Accuracy? Accurate to the second?

    How to find the remaining time in setTimeout?

    Sets the timer to an "exact" interval. Accuracy is achieved by the fact that the function is called once a second (the interval is configurable) and adjusts the time remaining before the event. Actual accuracy depends on the load on the computer at the time of the timer.

    To fire at the right time, you need to specify this time in the format with a time zone.

    function setMyTimer(_t, interval){
    _t.log_interval=_t.log_interval || 1000;

    function log(){
    const diff=_t.interval - ( - _t.start);
    else {


    let AlertTime=new Date('2020-11-18T10:39:00+03:00') ;

    setMyTimer(()=>alert('Доставка!'), AlertTime.valueOf();

  • 0
    This is done like this, setInterval () is set to check the current time, let's say every hour, when there are several hours left before the appointed date, we change the check interval and already check the date every minute. In a few minutes, we begin to check the time every second and a few seconds before the required time, we roll out setTimeout () with the exact number of milliseconds to run your command at the exact specified time.
    Willow Shah

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!