Function to add or subtract the number of minutes to the specified date.

 

Syntax

function IncMinute(dt: double; iMinutes: int64): double;

 

Parameters and return values

Parameter

Type

Value

dt

double

date/time value to which you need to add or subtract minutes;

iMinutes

int64

number of minutes that you need to add or subtract. If the number is positive — add minutes, if negative — subtract.

.

Function result

Returns a date/time value shifted by a specified number of minutes.

 

Example


var
  dt: double;
begin
  dt := Now;
  
  mLogScript(FormatDateTime('hh:nn', dt), 'now');
  
  dt := IncMinute(dt, 90);
  mLogScript(FormatDateTime('hh:nn', dt), '+1 hour and 30 minutes');
end.


Script work result

[15:46:30] (Log "IncMinute"): [now] 15:46

[15:46:30] (Log "IncMinute"): [+1 hour and 30 minutes] 17:16

 

See also

FormatDateTime
mLogScript

Now