MyChat Scripts Engine: IncSecond
Function to add or subtract the number of seconds to the specified date.
Syntax
function IncSecond(dt: double; iSeconds: int64): double;
parameters and return values
Parameter |
Type |
Value |
dt |
double |
date/time value to which you need to add or subtract seconds; |
iSeconds |
int64 |
number of seconds which you need to add or subtract. If the number is positive add seconds, if negative subtract. |
Function result
Returns a date/time value shifted by a specified number of seconds.
Example
var
dt: double;
begin
dt := Now;
mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss:zzz', dt), 'now');
dt := IncSecond(dt, 10);
mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss:zzz', dt), '+10 seconds');
end.
The result of script work
[15:40:11] (Log "IncSecond"): [now] 02.23.2016 15:40:11:803
[15:40:11] (Log "IncSecond"): [+10 seconds] 02.23.2016 15:40:21:803