2.0.2 • Published 6 years ago

tyme v2.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Tyme

Converting any time unit to any time unit

NPM Version Build Status Downloads Stats

Sometimes you want to convert hours to seconds. Something you want to know how many weeks are in a decade. And sometimes, you want to know how many blinks of an eye are in a day...

Installation

npm install tyme --save

Usage example

const tyme = require('tyme')
tyme.hours(5).inSeconds() // 18000
tyme.decades(1).inWeeks() // 521.4285714285714 

Also exposes the timeunit methods directly

const {hours, minutes} = require('tyme')
hours(3).inDays() // 0.125
minutes(60).inHours() // 1

Supported Time Units

NameSymbolValue
millisecondms0.001shectosecondhs1m + 40s
killosecondks16m + 40s
megasecondMs11d + 13h + 46m + 40s
gigasecondGs31Y + 287d
terasecondTs31600Y
seconds1s
minutem60s
hourh60m
dayd24h
weekw7d
monthM31d
yearY365d
decadeD10Y

Development setup

yarn install 
yarn test

Release History

see changelog.md

Meta

Guy Israeli – @isguyra

Distributed under the MIT license. See LICENSE for more information.

https://github.com/guyisra/tyme

Contributing

  1. Fork it (https://github.com/guyisra/tyme)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request
2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago