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

150
Vistas
Check if Number in minutes is a hour mark (60..120..180.. 240 mins etc)

Question

Figure out if a minute number is the exact number leading into an hour / hours.

Description

I have no code examples, as its something I'm trying to figure out.

I'm trying to build a script that basically returns true or false if the amount of seconds leads into an hour or x hours ; otherwise if not it returns false.

I'm unsure exactly how this should work, as it basically just all the time should check if the amount of minutes - would be the exact minutes to lead into an hour.. (This being 1 hour, 2 hours, 3 hours, 4 hours..... and so on)

I do not need to know how many hours it is or anything; i just need to know if its true or false if the amount of minutes would be exact to Is the amount of minutes an exact hour hour timers.

Expected Workflow examples

The minute number is just a const/let/var input being (example: 59, 60, 120, 300, 673)

If Minute Number is 0-59 Return false

If Minute Number is 60 Return true (Because this would be 1 Hour)

If Minute Number is 60-119 Return false

If Minute Number is 120 Return true (Because this would be exact 2 Hours)

If Minute Number is 121-179 Return false

If Minute Number is 180 Return true (Because this would be exact 3 Hours)

... and so on, basically endless - it just has to return true on any exact is minute an hour part, otherwise false.

My thoughts i had to complete, but not sure

I would guess you would need to check if the minute number is divded by 60 or something like that; but im unsure.

Hope someone is able to help me out, thank you in advance.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are looking for the modulo (%) operator

function IsOnHour(minutes) {
  return minutes % 60 == 0
}

console.log(IsOnHour(59))
console.log(IsOnHour(60))
console.log(IsOnHour(61))
console.log(IsOnHour(120))

Produces

false
true
false
true
about 4 years ago · Juan Pablo Isaza Denunciar
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