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

1.0.1 • Public • Published

@ilihub/day

TypeScript functions for converting day to other time units.

NPM Version NPM CodeFactor Socket Badge

Installation

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

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

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

Usage

import { Day } from "@ilihub/day";

const day = new Day(1);

const milliseconds = day.toMillisecond();
console.log(milliseconds); // 86400000

const seconds = day.toSecond();
console.log(seconds); // 86400

const minutes = day.toMinute();
console.log(minutes); // 1440

const hours = day.toHour();
console.log(hours); // 24

const weeks = day.toWeek();
console.log(weeks); // 0.14285714285714285

const months = day.toMonth();
console.log(months); // 0.03333333333333333

const years = day.toYear();
console.log(years); // 0.0027397260273972603

const decades = day.toDecade();
console.log(decades); // 0.000273972602739726

const centuries = day.toCentury();
console.log(centuries); // 0.000027397260273972603

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/day

Weekly Downloads

49

Version

1.0.1

License

MIT

Unpacked Size

11.9 kB

Total Files

5

Last publish

Collaborators

  • harshraj8843