Static Methods
Static methods of Chronos
Overview
Chronos static methods are methods that are called on the Chronos class itself, rather than on an instance of Chronos. They are used to perform operations that are not specific to any particular Chronos instance.
Available Static Methods
| Method | Short Description |
|---|---|
| now() | Returns the number of milliseconds since 1970-01-01 UTC. |
| use() | Injects a plugin into the Chronos system. |
| register() | Alias for use() |
| utc() | Creates a UTC-based Chronos instance. |
| with() | Creates a new instance with the provided time component(s). |
| reconstruct | Reconstructs a Chronos instance from a given value. |
| parse() | Parses a date string with a given format (limited support only). |
| min() | Returns earliest Chronos. |
| max() | Returns latest Chronos. |
| clamp() | Restricts a date to a specified range |
| today() | Returns the current date in a specified format in local time. |
| tomorrow() | Returns a new Chronos instance representing tomorrow's date. |
| yesterday() | Returns a new Chronos instance representing yesterday's date. |
| formatTimePart() | Formats a time-only string into a formatted time string. |
| getDatesForDay() | Returns ISO date strings for each occurrence of a weekday. |
| isLeapYear() | Checks if the year in the date or year is a leap year. |
| isValidChronos() | Checks if the given value is an instance of Chronos. |
| isValidDate() | Checks if the given value is a valid Date object. |
| isDateString() | Checks if the given value is a valid date string. |
| isReconstructable | Checks if a value can be used to reconstruct a Chronos instance. |
Examples
playground.ts
Last updated: Tue, Jun 23, 2026 07:34:42PM (UTC)
