times-converter
v1.0.2
Published
Node.js module to convert millisecond, second, minute, hour, day into all the others in an instant
Downloads
1
Maintainers
Readme
times-converter
Installation:
npm install times-converter
Usage:
const timesConverter = require('times-converter');
let daysTo = await timesConverter.days.daysToAll(1)
let hoursTo = await timesConverter.hours.hoursToAll(24)
let minutesTo = await timesConverter.minutes.minutesToAll(60)
let secondsTo = await timesConverter.seconds.secondsToAll(60)
let msTo = await timesConverter.ms.msToAll(1000)
Expected return:
daysTo: { hours: 24, minutes: 1440, seconds: 86400, milliseconds: 86400000 }
|
hoursTo: { days: 1, minutes: 1440, seconds: 86400, milliseconds: 86400000 }
|
minutesTo: { days: 0, hours: 1, seconds: 3600, milliseconds: 3600000 }
|
secondsTo: { days: 0, hours: 0, minutes: 1, milliseconds: 60000 }
|
msTo: { days: 0, hours: 0, minutes: 0, seconds: 1 }