Skip to content

Instantly share code, notes, and snippets.

@fffiloni
Forked from martinbean/convert-seconds.js
Created January 28, 2021 13:42
Show Gist options
  • Save fffiloni/fa5089f773b8823349b25dfc2c8ac68b to your computer and use it in GitHub Desktop.
Save fffiloni/fa5089f773b8823349b25dfc2c8ac68b to your computer and use it in GitHub Desktop.
Convert seconds to HH:MM:SS format in JavaScript.
new Date(seconds * 1000).toISOString().substr(11, 8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment