1.0.1 • Published 6 months ago

@ilihub/day v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@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