Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
tiempo restante en tiempo real con javascript

Quiero mostrar el tiempo restante dentro de un bucle foreach. Quiero mostrar la diferencia entre la columna de activationEndTime y la hora actual en la base de datos;

este código no funciona bien para mí, ¿qué debo hacer?

 (function() { const second = 1000, minute = second * 60, hour = minute * 60, day = hour * 24 let myTime = '<?= $key->activationEndTime?>' countDown = new Date(myTime).getTime(), x = setInterval(function() { let now = new Date().getTime(), fark = countDown - now; document.getElementById("minutesx").innerText = Math.floor((fark % hour) / minute); if (0 >= fark) { clearInterval(x); document.getElementById("countdown-Key").innerHTML = '<span>Süre Doldu</span>' } }, 0) }());
 <div class="sverification-inner" id="countdown-Key"> <ul style="text-align: center"> <li> <span id="minutesx" class="timers"></span> <span class="times">DAKİKA</span> </li> </ul> </div>

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!