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

152
Views
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 answers
Answer question

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 Report
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!