Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.
/ hms Public archive

get hours, minutes and seconds from milliseconds

Notifications You must be signed in to change notification settings

yields/hms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hms

get hours, minutes and seconds from milliseconds.

Installation

$ component install yields/hms

Example

var ret = hms(2400000);
ret;
// > { h: 0, m: 40, s: 0 }
ret[0];
// > 0
ret[1];
// > 40
ret[2];
// > 0
ret.join(':');
// > 0:40:0
ret.map(function(n){ return 10 > n ? '0' + n : n; }).join(':');
// > 00:40:00

License

MIT

About

get hours, minutes and seconds from milliseconds

Resources

Stars

Watchers

Forks

Packages

No packages published