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

155
Views
vanilla js - How would i display a video.currentTime value in a minutes:seconds

I'm trying to get my website to return its video.currentTime value in a minutes:seconds way

For example, this is what I need: 00:10

But I am getting: 10.04

Code:

video.ontimeupdate = () => { 
duration.textContent = video.currentTime
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

video.currentTime outputs the video time in seconds.

You can just convert it to minutes and seconds.

let time = video.currentTime;
let minutes = Math.floor(time / 60);
let seconds = Math.floor(time - minutes * 60);
let timeString = `${minutes}:${seconds}`;
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!