🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

from-seconds

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

from-seconds

Convert seconds to minutes, hours, days, months, years...

1.0.2
latest
Version published
Weekly downloads
149
-42.25%
Maintainers
1
Weekly downloads
 
Created

from-seconds

Convert seconds to minutes, hours, days, months, years...

Install

$ npm install from-seconds

Usage

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 }

License

The MIT License @ 2019

FAQs

Package last updated on 04 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts