@ilihub/hour
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@ilihub/hour

TypeScript functions for converting hour to other time units.

NPM Version NPM CodeFactor Socket Badge

Installation

# if you're using pnpm
pnpm add @ilihub/hour

# or, if you're using npm
npm install @ilihub/hour

# or, if you're using yarn
yarn add @ilihub/hour

Usage

import { Hour } from "@ilihub/hour";

const hour = new Hour(1);

const milliseconds = hour.toMillisecond();
console.log(milliseconds); // 3600000

const seconds = hour.toSecond();
console.log(seconds); // 3600

const minutes = hour.toMinute();
console.log(minutes); // 60

const days = hour.toDay();
console.log(days); // 0.041666666666666664

const weeks = hour.toWeek();
console.log(weeks); // 0.005952380952380952

const months = hour.toMonth();
console.log(months); // 0.001388888888888889

const years = hour.toYear();
console.log(years); // 0.00011415525114155251

const decades = hour.toDecade();
console.log(decades); // 0.000011415525114155251

const centuries = hour.toCentury();
console.log(centuries); // 0.0000011415525114155251

Available Functions and Classes


Sponsors & Backers

Support the development of new open-source projects from ilihub through crowdfunding.

The core of ilihub is our crowd-funded open-source projects, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development.

Sponsors


Package Sidebar

Install

npm i @ilihub/hour

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

12.3 kB

Total Files

5

Last publish

Collaborators

  • harshraj8843