ms-to-hms
Tiny module that takes milliseconds and outputs as h:mm:ss
5025000
→'1:23:45'
Install
npm install ms-to-hms
Usage
const msToHms = // '0:00:00' // '-0:10:54' // '34:17:36'
API
msToHms(ms)
Convert milliseconds into formatted time string.
Parameters
ms
Time in milliseconds. Can be either positive or negative.- Type:
number
- Note: the function will throw if
ms
is aNaN
or anything but anumber
.
- Type:
License
MIT