@ilihub/month
v1.0.1
Published
TypeScript functions for converting month to other time units.
Downloads
20
Maintainers
Readme
@ilihub/month
TypeScript functions for converting month to other time units.
Installation
# if you're using pnpm
pnpm add @ilihub/month
# or, if you're using npm
npm install @ilihub/month
# or, if you're using yarn
yarn add @ilihub/month
Usage
import { Month } from "@ilihub/month";
const month = new Month(1);
const milliseconds = month.toMillisecond();
console.log(milliseconds); // 2629800000
const seconds = month.toSecond();
console.log(seconds); // 2629800
const minutes = month.toMinute();
console.log(minutes); // 43830
const hours = month.toHour();
console.log(hours); // 720
const days = month.toDay();
console.log(days); // 30
const weeks = month.toWeek();
console.log(weeks); // 4
const years = month.toYear();
console.log(years); // 0.08333333333333333
const decades = month.toDecade();
console.log(decades); // 0.008333333333333333
const centuries = month.toCentury();
console.log(centuries); // 0.0008333333333333333
Available Functions and Classes
- Month
- Month To Millisecond
- Month To Second
- Month To Minute
- Month To Hour
- Month To Day
- Month To Week
- Month To Year
- Month To Decade
- Month 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.