tiempo

addMinutes

Add minutes to a datetime

Add minutes to a datetime.

Signature

function addMinutes(
  input: Temporal.Instant | Temporal.ZonedDateTime,
  minutes: number
): Temporal.ZonedDateTime

Parameters

ParameterTypeDescription
inputTemporal.Instant | Temporal.ZonedDateTimeThe datetime to add minutes to
minutesnumberNumber of minutes to add (can be negative)

Returns

A Temporal.ZonedDateTime with the minutes added.

Examples

import { addMinutes } from '@gobrand/tiempo';

const instant = Temporal.Instant.from('2025-01-20T12:00:00Z');
addMinutes(instant, 45);
// 2025-01-20T12:45:00Z[UTC]

On this page