ChronosChronos

add

Returns a new Chronos instance with the specified unit added.

add()

Returns a new Chronos instance with the specified unit added.

Signatures

add(value: number, unit: TimeUnit): Chronos

add(units: UnitWithValue): Chronos

Parameters

Parameter 1

  • value: Number of units to add
  • units: An object specifying which time units to add. At least one unit-value pair is required.

Parameter 2

  • unit: Time unit to add ('year', 'month', 'day', etc.)

Return Type

Chronos - New instance with added time

Notes

  • Returns new immutable instance
  • Handles month/year overflow automatically

Example

playground.ts

Important Note for UnitWithValue

  • All properties are optional, but at least one must be provided. Values accept both number and numeric string types (Numeric).
  • For more details, refer to addDate which returns Date object and is used internally

Alternatives

Last updated: Mon, Jun 15, 2026 06:37:26PM (UTC)

On this page