Quick Start
Get up and running with chronos-date in minutes.
Creating Instances
There are multiple ways to create a Chronos instance:
Using the Constructor
import { Chronos } from "chronos-date";
// Current date and time
const now = new Chronos();
// From a date string
const date = new Chronos("2025-12-31");
// From a timestamp
const fromTimestamp = new Chronos(1735689600000);
// From a Date object
const fromDate = new Chronos(new Date());
// From components
const custom = new Chronos(2025, 6, 15, 14, 30, 0);Using the Wrapper Function
The chronos function provides the same functionality with a simpler syntax:
import { chronos } from "chronos-date";
const date = chronos("2025-12-31");
date.year; // 2025
date.monthName; // "December"Basic Operations
playground.ts
Using Plugins
Extend Chronos with plugins for additional functionality:
playground.ts
Important
Register plugins at the top of your application entry point, before creating any Chronos instances.
Last updated: Wed, May 20, 2026 07:50:59AM (UTC)
