Docly Developers
Function Updated 19 Oct 2026

addMinutes(datetime, minutes)

Adding a number of minutes (positive or negative value) to a specified date and time object.

Parameters

datetimedatetimerequired

Date and time object on which to add minutes to.

minutesnumberrequired

How many minutes to add to specified datetime.

Returns

A modified date and time object, does not modify input date.

Example

Mixed HTML (or any text file) with inline JavaScript between hash signs.
#{
    var before = new Date(); // Create new date and time object
    var after = docly.addMinutes(before, 3.5); // Add minutes
}#
<b>Before:</b> #format(before, "HH:mm:ss")#
<b>After:</b> #format(after, "HH:mm:ss")#