Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

from-seconds

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

from-seconds

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

    1.0.2latest
    GitHub

Version published
Maintainers
1
Weekly downloads
544
decreased by-44.99%

Weekly downloads

Readme

Source

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

Keywords

FAQs

Last updated on 04 Apr 2019

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.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc