from-seconds
Advanced tools
Weekly downloads
Readme
Convert seconds to minutes, hours, days, months, years...
$ npm install from-seconds
Pass in seconds (as a number
or string
), and get an object:
import { fromSeconds } from 'from-seconds';
const result = fromSeconds(31503661);
result.toMinutes();
// => { minutes: 525061, seconds: 1 }
result.toHours();
// => { hours: 8751, minutes: 1, seconds: 1 }
result.toDays();
// => { days: 364, hours: 15, minutes: 1, seconds: 1 }
result.toMonths();
// => { months: 11, days: 29, hours: 15, minutes: 1, seconds: 1 }
result.toYears();
// => { years: 0, months: 11, days: 29, hours: 15, minutes: 1, seconds:1 }
The MIT License @ 2019
FAQs
Convert seconds to minutes, hours, days, months, years...
The npm package from-seconds receives a total of 431 weekly downloads. As such, from-seconds popularity was classified as not popular.
We found that from-seconds demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.