Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Convert seconds to HH:MM:SS format in JavaScript.
new Date(seconds * 1000).toISOString().substr(11, 8)
@raskri

This comment has been minimized.

Copy link

commented Nov 23, 2016

NICE one

@floydback

This comment has been minimized.

Copy link

commented May 24, 2017

super!

@sidvishnoi

This comment has been minimized.

Copy link

commented Jan 7, 2018

limitation: the duration cannot be more than 24 hours (it'll overflow)

@webix

This comment has been minimized.

Copy link

commented Feb 21, 2018

nice!

@yhenni1989

This comment has been minimized.

Copy link

commented Jan 22, 2019

Phenomenal dude!

@shaunjanssens

This comment has been minimized.

Copy link

commented Mar 4, 2019

Nice, thanks!

@MTGPROD

This comment has been minimized.

Copy link

commented Aug 29, 2019

This is incredible, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.