convert-seconds-to-human

1.1.0 • Public • Published

Help

Convert seconds into Y/D/H/M/S, in calendar and astronomical format.

To install the package :

npm i convert-seconds-to-human

Remember to require the package :

const convert = require('convert-seconds-to-human')

Examples

First example with cal format

const resultCal = convert(123456789, 'cal')

console.log(resultCal)
/* result :  {
    years: 3,
    days: 333,
    hours: 21,
    minutes: 33,
    seconds: 9
}*/

Second example with astr format

const resultAstr = convert(123456789, 'astr')

console.log(resultAstr)

/* result :  {
    years: 3,
    days: 333,
    hours: 3,
    minutes: 33,
    seconds: 9
}*/

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    9
    • latest

Version History

Package Sidebar

Install

npm i convert-seconds-to-human

Weekly Downloads

9

Version

1.1.0

License

ISC

Unpacked Size

5.91 kB

Total Files

5

Last publish

Collaborators

  • romainlt