Skip to content

Instantly share code, notes, and snippets.

View RedStone576's full-sized avatar

RedStone576

View GitHub Profile

Projects, tools, and docs i've curated throughout the years, some stuff has been removed or kept for reasons.

Authored by me

Project Description Note
https://github.com/RedStone576/Tetrio-Map-Collection hidden
https://github.com/RedStone576/finbot discord bot hidden
https://github.com/RedStone576/tetrio-minus customization extension for chromium delayed
https://github.com/RedStone576/img2tetr
https://github.com/RedStone576/tetrlink tetr.io to discord stats linking
@RedStone576
RedStone576 / MsToTime.js
Last active March 19, 2022 05:10
convert milliseconds to hours:minute:seconds.milliseconds
//https://stackoverflow.com/questions/19700283/how-to-convert-time-in-milliseconds-to-hours-min-sec-format-in-javascript
function time(duration) {
let answerToLife = parseInt(duration % 1000)
let seconds = Math.floor((duration / 1000) % 60)
let minutes = Math.floor((duration / (1000 * 60)) % 60)
let hours = Math.floor((duration / (1000 * 60 * 60)) % 24)
hours = hours < 10 ? "0" + hours : hours
minutes = minutes < 10 ? "0" + minutes : minutes