Home>

There is a website https://megatimer.ru/on which I set the end date of the timer and the timer itself, and there is a megatimer.js file in which the code for the end of the timer and everything else is written (but I can’t find it (maybe even the problem is not in the file, but in something else), I need help with this). The customer needs to set the timer by himself, how to do it? (I just need to tell him a string)

Here is the timer code

(function() {
  var_id= "65dc1667e4a669bb6a36cf929343c29d";
  while (document.getElementById("timer" + _id)) _id= _id + "0";
  document.write("<div id='timer" + _id + "' style='min-width:488px;height:147px;'></div>");
  var_t= document.createElement("script");
  _t.src= "https://megatimer.ru/timer/timer.min.js";
  var _f= function(_k) {
    var l= new MegaTimer(_id, {
      "view": [1, 1, 0, 0],
      type: {
        "currentType": "1",
        params: {
          usertime: true
          "tz": "3",
          "utc": 1563055200000
        }
      },
      design: {
        "type": "plate",
        params: {
          "round": "10",
          "background": "solid",
          "background-color": "#ffffff",
          "effect": "flipchart",
          "space": "12",
          "separator-margin": "28",
          "number-font-family": {
            "family": "Arial"
          },
          "number-font-size": "97",
          "number-font-color": "#000000",
          "padding": "24",
          "separator-on": false,
          "separator-text": ":",
          "text-on": false
          "text-font-family": {
            "family": "Arial"
          },
          "text-font-size": "24",
          "text-font-color": "#ffffff"
        }
      },
      "designId": 3,
      "theme": "white",
      width: 488
      height: 147
    });
    if (_k != null) l.run();
  };
  _t.onload= _f;
  _t.onreadystatechange= function() {
    if (_t.readyState== "loaded") _f(1);
  };
  var _h= document.head || document.getElementsByTagName("head")[0];
  _h.appendChild(_t);
}).call(this);

I understand the problem is in utc (universal time), but how can the customer set it up, even if I haven't figured it out yet? I only change the numbers in the utc code and so the time on the site changes

  • Answer # 1

    https://www.epochconverter.com/programming/php-how it all works

    My code:

    $new_date= date_create(date("Y-m-d H:i:s"));
    date_format($new_date, 'U'); //Format UNIX 1566382042
    $second_date= (date_timestamp_get($new_date))*1000; //Format in secconds
    

    You want something that comes out on $second_date, end time

    $new_date= date_create(date("2019-08-21 12:00:00"));
    
  • Answer # 2

    https://www.epochconverter.com/programming/php-how it all works

    My code:

    $new_date= date_create(date("Y-m-d H:i:s"));
    date_format($new_date, 'U'); //Format UNIX 1566382042
    $second_date= (date_timestamp_get($new_date))*1000; //Format in secconds
    

    You want something that comes out on $second_date, end time

    $new_date= date_create(date("2019-08-21 12:00:00"));
    
  • Answer # 3

    It's funnythat I'm also looking for an answer to this question. I can suggest trying to create a new counter on the site, just on the desired date and copy the desired utc number from the code of the new timer and substitute it into our timer. Haven't tried it yet, but logically it should work.

  • Answer # 4

    It's funnythat I'm also looking for an answer to this question. I can suggest trying to create a new counter on the site, just on the desired date and copy the desired utc number from the code of the new timer and substitute it into our timer. Haven't tried it yet, but logically it should work.