Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript format seconds into minutes and second

  function getTime(time) {
    //1:43
    // console.log(Math.floor(time % 60))
    return Math.floor(time / 60) + ':' + ('0' + Math.floor(time % 60)).slice(-2)
  }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #format #seconds #minutes
ADD COMMENT
Topic
Name
6+1 =