@ilihub/year
v1.0.1
Published
TypeScript functions for converting year to other time units.
Downloads
23
Maintainers
Readme
@ilihub/year
TypeScript functions for converting year to other time units.
Installation
# if you're using pnpm
pnpm add @ilihub/year
# or, if you're using npm
npm install @ilihub/year
# or, if you're using yarn
yarn add @ilihub/year
Usage
import { Year } from "@ilihub/year";
const year = new Year(1);
const millisecond = year.toMillisecond();
console.log(millisecond); // 31536000000
const second = year.toSecond();
console.log(second); // 31536000
const minute = year.toMinute();
console.log(minute); // 525600
const hour = year.toHour();
console.log(hour); // 8760
const day = year.toDay();
console.log(day); // 365
const week = year.toWeek();
console.log(week); // 52
const month = year.toMonth();
console.log(month); // 12
const decade = year.toDecade();
console.log(decade); // 0.1
const century = year.toCentury();
console.log(century); // 0.01
Available Functions and Classes
- Year
- Year To Millisecond
- Year To Second
- Year To Minute
- Year To Hour
- Year To Day
- Year To Week
- Year To Month
- Year To Decade
- Year 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.