Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js seconds to time

const secs2Time = (secs) => {
  const hours = Math.floor(secs / 60 / 60).toString().padStart(2, 0)
  return hours + ':' + new Date(secs * 1000).toISOString().substr(14, 5)
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #seconds #time
ADD COMMENT
Topic
Name
7+4 =