Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.07 KB

README.md

File metadata and controls

53 lines (38 loc) · 1.07 KB

Node.JS

What is this?

This package brings functions that convert seconds into formatted time. Use the seconds you want to convert as argument.

shortTime(int seconds)
longTime(int seconds)

How to Import

//Just shortTime() function
const { shortTime } = require('@kykal/time-formatted')

//Just longTime() function
const { longTime } = require('@kykal/time-formatted');

//All functions (can import with whatever name you want)
const times = require('@kykal/time-formatted');

Examples

shortTime(int seconds)

console.log( shortTime(821) );
//Output: 13:41 

console.log( shortTime(8286) );
//Output: 2:18:06

console.log( times.shortTime(342) );
//Output: 5:42

longTime(int seconds)

console.log( longTime(321) );
//Output: 00:05:21

console.log( longTime(3609) );
//Output: 01:00:09 

console.log( times.longTime(657) );
//Output: 00:10:57