Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
Turning an input (amount of seconds) into an HH:MM:SS format for from API

I am currently using an API system to return the amount of time that someone has beaten a certain game in Hypixel (Minecraft). This API system returns the time in seconds and it would be much more convenient for it to be in the HH:MM:SS format. Based on some math I have come up with this:

const player = {
  stats: {
    arcade: {
      zombies: {
        overall: {
          fastestRound30: 2214
        }
      }
    }
  }
}

function zombieMath() {

  seconds = player.stats.arcade.zombies.overall.fastestRound30
  splice = seconds / 3600
  full_hours = Math.floor(splice)
  minutes = seconds - full_hours * 60
  full_minutes = Math.floor(minutes)
  remaining_seconds = minutes - full_minutes * 60

  return `${full_hours}:${full_minutes}:${remaining_seconds}`
}

console.log(zombieMath())

I don't fully understand this math, but it has to do with splicing the amount of full hours and minutes and multiply the rest with the remaining seconds. Although the console says something else : Fastest Round 30: 0:2152:-126968

How would I fix this problem? For reference I was trying to output 2,214 to HH:MM:SS format which is just under 37 minutes

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda