@ilihub/day
v1.0.1
Published
TypeScript functions for converting day to other time units.
Downloads
21
Maintainers
Readme
@ilihub/day
TypeScript functions for converting day to other time units.
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
- Day
- Day To Millisecond
- Day To Second
- Day To Minute
- Day To Hour
- Day To Week
- Day To Month
- Day To Year
- Day To Decade
- Day To Century
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.