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
datetimedatetimerequiredDate and time object on which to add minutes to.
minutesnumberrequiredHow 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")#The template above produces this output:
<b>Before:</b> 14:05:48
<b>After:</b> 14:09:18