hours-minutes-seconds
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

hours-minutes-seconds

constant width time eg. 12:34:56 or 03:02:01

usage

npm i hours-minutes-seconds

or

npm i -D hours-minutes-seconds

Called with no arguments, the time will be the current time.

import hms from 'hours-minutes-seconds';
console.log(hms());  // 09:15:27 (if the time was quarter past nine in the morning)

Alternatively pass a date object.

import hms from 'hours-minutes-seconds';
const timeIn30Minutes = new Date(+new Date() + 1.8e6);
console.log(hms(timeIn30Minutes));  // 09:45:27 (if the time was quarter past nine in the morning)

Package Sidebar

Install

npm i hours-minutes-seconds

Weekly Downloads

2

Version

2.0.1

License

MIT

Unpacked Size

2.52 kB

Total Files

5

Last publish

Collaborators

  • paul-browne